fapi/app/schemas.py

85 lines
1.3 KiB
Python
Raw Permalink Normal View History

2024-10-24 11:24:33 +00:00
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):
2024-10-23 12:20:21 +00:00
first_name: str
2024-10-24 11:24:33 +00:00
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
2024-10-23 12:20:21 +00:00
class Config:
orm_mode = True