This commit is contained in:
xuyue committed 2026-03-04 00:04:39 +08:00
1 parent 04721a035b
commit fdbe06a077
5 files changed
+116 -2

No files matched your search

+22 -1
View File
@@ -1,5 +1,5 @@
from ninja import Schema, ModelSchema
from .models import Tutorial
from .models import Tutorial, Challenge
class TutorialSlim(Schema):
@@ -19,3 +19,24 @@ class TutorialIn(Schema):
title: str
content: str
is_public: bool = False
class ChallengeSlim(Schema):
display: int
title: str
score: int
is_public: bool
class ChallengeAll(ModelSchema):
class Meta:
model = Challenge
fields = "__all__"
class ChallengeIn(Schema):
display: int
title: str
content: str
score: int = 0
is_public: bool = False