mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
replace drf by django-ninja
This commit is contained in:
15
core/schemas.py
Normal file
15
core/schemas.py
Normal file
@ -0,0 +1,15 @@
|
||||
from ninja import ModelSchema, Schema
|
||||
|
||||
from core.models import User
|
||||
|
||||
|
||||
class SimpleUserSchema(ModelSchema):
|
||||
"""A schema with the minimum amount of information to represent a user."""
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ["id", "nick_name", "first_name", "last_name"]
|
||||
|
||||
|
||||
class MarkdownSchema(Schema):
|
||||
text: str
|
Reference in New Issue
Block a user