教程模块
This commit is contained in:
1 parent
fd46f49c20
commit
d3ffd27f00
14 files changed
+161
-11
No files matched your search
@@ -0,0 +1,28 @@
|
||||
from ninja import Schema, ModelSchema
|
||||
from typing import List, Optional
|
||||
from .models import Tutorial
|
||||
|
||||
|
||||
class TutorialSlim(Schema):
|
||||
display: str
|
||||
title: str
|
||||
is_public: bool
|
||||
|
||||
|
||||
class TutorialAll(ModelSchema):
|
||||
class Meta:
|
||||
model = Tutorial
|
||||
fields = "__all__"
|
||||
|
||||
|
||||
class TutorialReturn(Schema):
|
||||
total: int
|
||||
list: List[TutorialSlim]
|
||||
first: Optional[TutorialAll]
|
||||
|
||||
|
||||
class TutorialIn(Schema):
|
||||
display: str
|
||||
title: str
|
||||
content: str
|
||||
is_public: bool = False
|
||||
Reference in new issue
Block a user