Skip to content

Commit 6d9e210

Browse files
committed
Bump orjson package and fix Schema type errors
1 parent 9fa909a commit 6d9e210

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

apidemo/db.sqlite3

0 Bytes
Binary file not shown.

apidemo/test_app/views.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
class EmployeeIn(Schema):
1616
first_name: str
1717
last_name: str
18-
department_id: int = None
19-
birthdate: date = None
18+
department_id: int
19+
birthdate: date
2020

2121

2222
class DepartmentIn(Schema):
@@ -30,8 +30,8 @@ class EmployeeOut(Schema):
3030
id: int
3131
first_name: str
3232
last_name: str
33-
department__title: str = None
34-
birthdate: date = None
33+
department__title: str
34+
birthdate: date
3535

3636

3737
class DeptOut(Schema):
@@ -78,7 +78,7 @@ def create_employee(request, payload: EmployeeIn):
7878
:return: a dictionary with the key "id" and the value being the id of the created employee.
7979
"""
8080
employee = Employee.objects.create(**payload.dict())
81-
return {"id": employee.id}
81+
return {"id": employee.id} # type: ignore
8282

8383

8484
@api_v1.get("/departments", response=List[DeptOut])
@@ -103,7 +103,7 @@ async def get_all_employees_departmentwise_async(request):
103103
104104
:param request: The `request` parameter is likely an HTTP request object that is passed to the
105105
function. It could contain information about the client's request, such as headers, query
106-
parameters, and request body. However, in the given code snippet, the `request` parameter is not
106+
parameters, and request body. However, in the given code snippet, the `request` parameter is not()
107107
used, so it may not
108108
:return: a list of all the Department objects, ordered by their title.
109109
"""

requirement.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ asgiref==3.7.2
33
colorama==0.4.6
44
Django==5.0.1
55
django-ninja==1.1.0
6-
orjson==3.9.10
6+
orjson==3.9.12
77
packaging==23.2
88
PLTable==1.1.0
99
pydantic==2.5.3

0 commit comments

Comments
 (0)