Gurucool_Test / schemas /assignment.py
ashwinR's picture
Upload 245 files
b7a7f32
raw
history blame
1.23 kB
from tokenize import group
from typing import Optional, List, Any # noqa
from datetime import datetime
from pydantic import BaseModel
from schemas import TeacherShort, CourseMin, GroupReturn
class AssignmentBase(BaseModel):
due_date: datetime
marks: int = None
title: str
contents: str = None
files: List[Any] = None
instructor: List[int]
group: List[int]
course_id: int
class AssignmentCreate(AssignmentBase):
instructor: Optional[List[int]]
class AssignmentUpdate(AssignmentBase):
due_date: datetime = None
marks: int = None
title: str = None
contents: str = None
files: List[Any] = None
instructor: List[int] = None
group: List[int] = None
course_id: int = None
class AssignmentInDBBase(AssignmentBase):
id: Optional[int]
class Config:
orm_mode = True
class AssignmentInDB(AssignmentInDBBase):
pass
class Assignment(BaseModel):
id: Optional[int]
due_date: datetime = None
marks: int = None
title: str
contents: str = None
files: List[Any] = None
instructor: List[TeacherShort]
group: List[GroupReturn]
course: CourseMin
exists: Optional[bool]
class Config:
orm_mode = True