Skip to content

Commit

Permalink
changed python to python3 in readme and added support version 2 of py…
Browse files Browse the repository at this point in the history
…dantic
  • Loading branch information
darixsamani committed Oct 3, 2023
1 parent 71b7563 commit 3a1f5be
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 42 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ python3 -m venv venv
4. Start the application:

```console
python main.py
python3 main.py
```


Expand Down
2 changes: 1 addition & 1 deletion config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Settings(BaseSettings):

class Config:
env_file = ".env.dev"
orm_mode = True
from_attributes = True


async def initiate_database():
Expand Down
39 changes: 0 additions & 39 deletions models/student.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]",
"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",
}
}
2 changes: 1 addition & 1 deletion schemas/student.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Response(BaseModel):
data: Optional[Any]

class Config:
schema_extra = {
json_schema_extra = {
"example": {
"status_code": 200,
"response_type": "success",
Expand Down

0 comments on commit 3a1f5be

Please sign in to comment.