Skip to content

Commit

Permalink
[imp] team extra fields to save discord channel team_id and role_id
Browse files Browse the repository at this point in the history
  • Loading branch information
darloof committed Feb 19, 2024
1 parent 10f10bd commit 28f4c1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions psycity/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ class Team(BaseModel):
max_bank_loan = models.IntegerField(default=0)
last_bank_action = models.DateTimeField(blank=True, null=True)
today_bought_question = models.IntegerField(default=0)
channel_id = models.IntegerField(default=0)
channel_role = models.IntegerField(default=0)

def __str__(self):
return self.name
Expand Down
9 changes: 7 additions & 2 deletions psycity/models_retrieve_api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ class Meta:
fields = [
"id",
"name",
"state"
"state",
"team_role",
"wallet",
"total_asset",
"level",
"channel_id",
"channel_role",
]
class TeamPlayerSerializer(serializers.ModelSerializer):
roles = serializers.SerializerMethodField()
Expand Down Expand Up @@ -47,7 +53,6 @@ class Meta:
def get_players(self, obj):
players = obj.player_team.all()
players_serializer = TeamPlayerSerializer(players, many=True)
print(players_serializer.data)
return players_serializer.data


Expand Down

0 comments on commit 28f4c1a

Please sign in to comment.