Skip to content

Commit

Permalink
added more data for game list
Browse files Browse the repository at this point in the history
  • Loading branch information
ychebyshev committed Feb 4, 2024
1 parent 3b63e53 commit 1053631
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shvatka/api/models/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ class Page(Generic[T]):
class Player:
id: int
can_be_author: bool
name_mention: str

@classmethod
def from_core(cls, core: dto.Player):
return cls(
id=core.id,
can_be_author=core.can_be_author,
name_mention=core.name_mention,
)


Expand All @@ -51,7 +53,8 @@ class Game:
author: Player
name: str
status: GameStatus
start_at: datetime | None
start_at: datetime | None = None
number: int | None = None

@classmethod
def from_core(cls, core: dto.Game | None):
Expand All @@ -63,6 +66,7 @@ def from_core(cls, core: dto.Game | None):
name=core.name,
status=core.status,
start_at=core.start_at,
number=core.number,
)


Expand Down

0 comments on commit 1053631

Please sign in to comment.