diff --git a/README.md b/README.md index fea778e..49acec8 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ $ python3 -m venv venv 4. Start the application: ```console -python main.py +python3 main.py ``` diff --git a/config/config.py b/config/config.py index 70075ed..2f2ebd0 100644 --- a/config/config.py +++ b/config/config.py @@ -16,7 +16,7 @@ class Settings(BaseSettings): class Config: env_file = ".env.dev" - orm_mode = True + from_attributes = True async def initiate_database(): diff --git a/models/student.py b/models/student.py index 858647c..6503e4a 100644 --- a/models/student.py +++ b/models/student.py @@ -24,42 +24,3 @@ class Config: class Settings: name = "student" - - -class UpdateStudentModel(BaseModel): - fullname: Optional[str] - email: Optional[EmailStr] - course_of_study: Optional[str] - year: Optional[int] - gpa: Optional[float] - - class Collection: - name = "student" - - class Config: - schema_extra = { - "example": { - "fullname": "Abdulazeez Abdulazeez", - "email": "abdul@school.com", - "course_of_study": "Water resources and environmental engineering", - "year": 4, - "gpa": "5.0", - } - } - - -class Response(BaseModel): - status_code: int - response_type: str - description: str - data: Optional[Any] - - class Config: - schema_extra = { - "example": { - "status_code": 200, - "response_type": "success", - "description": "Operation successful", - "data": "Sample data", - } - } diff --git a/schemas/student.py b/schemas/student.py index 15a02ab..3fc03f9 100644 --- a/schemas/student.py +++ b/schemas/student.py @@ -29,7 +29,7 @@ class Response(BaseModel): data: Optional[Any] class Config: - schema_extra = { + json_schema_extra = { "example": { "status_code": 200, "response_type": "success",