18 lines
815 B
Python
18 lines
815 B
Python
|
from tortoise.contrib.pydantic import pydantic_model_creator
|
||
|
from database.rooms.models import Room, AnonymousMember, Parcours
|
||
|
Room_schema = pydantic_model_creator(
|
||
|
Room, name='room', include=["id", 'name', 'id_code'])
|
||
|
|
||
|
RoomIn_schema = pydantic_model_creator(Room, name='roomIn', exclude_readonly=True, exclude=[
|
||
|
'created_at', 'online', 'id_code', 'users_waiters'])
|
||
|
|
||
|
|
||
|
Anonymous_schema = pydantic_model_creator(
|
||
|
AnonymousMember, name='anonymousMember')
|
||
|
AnonymousIn_schema = pydantic_model_creator(
|
||
|
AnonymousMember, name='anonymousMemberIn', exclude_readonly=True, exclude=['id_code', 'room_id'])
|
||
|
|
||
|
Parcours_schema = pydantic_model_creator(Parcours, name='parcours')
|
||
|
ParcoursIn_schema = pydantic_model_creator(
|
||
|
Parcours, name='parcoursIn', exclude_readonly=True)
|