django ninja "schema"
# in viwes
# make sure you import Schema from ninja
from ninja import Schema
# make your class inharted from Schema
class DataSchema(Schema) :
name: str
age: int
part_of: 'DataSchema' = None
# update class
DataSchema.update_forward_refs()
# example
@account_controlear.post("")
def create_account(request, data_indax: DataSchema):
return data_indax.dict()