mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 05:07:10 +00:00
31 lines
548 B
Python
31 lines
548 B
Python
from uuid import UUID
|
|
|
|
from ninja import ModelSchema
|
|
|
|
from apps.competition.models import Competition
|
|
|
|
|
|
class CompetitionOut(ModelSchema):
|
|
id: UUID
|
|
|
|
class Meta:
|
|
model = Competition
|
|
fields = "__all__"
|
|
|
|
|
|
class CompetitionListInstanceOut(ModelSchema):
|
|
id: UUID
|
|
is_participating: bool
|
|
completed: bool
|
|
|
|
class Meta:
|
|
model = Competition
|
|
fields = (
|
|
"id",
|
|
"title",
|
|
"description",
|
|
"start_date",
|
|
"end_date",
|
|
"image_url",
|
|
)
|