教程模块

This commit is contained in:
xuyue committed 2025-03-03 22:10:45 +08:00
1 parent fd46f49c20
commit d3ffd27f00
14 files changed
+161 -11

No files matched your search

+28
View File
@@ -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