fapi/app/schemas.py

85 lines
1.3 KiB
Python

from pydantic import BaseModel
from datetime import datetime
class CriteriaBase(BaseModel):
name: str
class CriteriaCreate(CriteriaBase):
pass
class Criteria(CriteriaBase):
id: int
class Config:
orm_mode = True
class RoleBase(BaseModel):
name: str
class RoleCreate(RoleBase):
pass
class Role(RoleBase):
id: int
class Config:
orm_mode = True
class StudentBase(BaseModel):
first_name: str
last_name: str
grade: str
points: int
status: int
class StudentCreate(StudentBase):
pass
class Student(StudentBase):
id: int
class Config:
orm_mode = True
class ClassInfoBase(BaseModel):
school: str
city: str
year: str
semester: str
subject: str
level: str
publisher: str
class_name: str
group: str
profile: str
max_points: int
teacher: str
file_path: str
student_count: int
class ClassInfoCreate(ClassInfoBase):
pass
class ClassInfo(ClassInfoBase):
id: int
class Config:
orm_mode = True
class EventBase(BaseModel):
role_id: int
student_id: int
criteria_id: int
description: str
event_date: datetime
class EventCreate(EventBase):
pass
class Event(EventBase):
id: int
class Config:
orm_mode = True