重构数据
This commit is contained in:
1 parent
317f29b486
commit
c95dafe14d
32 files changed
+219
-215
No files matched your search
@@ -0,0 +1,21 @@
|
||||
from ninja import Schema, ModelSchema
|
||||
from .models import Tutorial
|
||||
|
||||
|
||||
class TutorialSlim(Schema):
|
||||
display: int
|
||||
title: str
|
||||
is_public: bool
|
||||
|
||||
|
||||
class TutorialAll(ModelSchema):
|
||||
class Meta:
|
||||
model = Tutorial
|
||||
fields = "__all__"
|
||||
|
||||
|
||||
class TutorialIn(Schema):
|
||||
display: int
|
||||
title: str
|
||||
content: str
|
||||
is_public: bool = False
|
||||
Reference in new issue
Block a user