Skip to content

Commit c6451c5

Browse files
rishikrc3arkid15r
andauthored
Feature/return type hints (#2643)
* Add feature: Add return type and parameter type hints to resolve_key * Add feature: added return hints for resolver methods in chapter, committe and project * Add feature: added parameter types to the arguments in resolver functions --------- Co-authored-by: Arkadii Yakovets <[email protected]>
1 parent e2ba109 commit c6451c5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

backend/apps/api/rest/v0/chapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ChapterBase(Schema):
2525
updated_at: datetime
2626

2727
@staticmethod
28-
def resolve_key(obj):
28+
def resolve_key(obj: ChapterModel) -> str:
2929
"""Resolve key."""
3030
return obj.nest_key
3131

backend/apps/api/rest/v0/committee.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class CommitteeBase(Schema):
2525
updated_at: datetime
2626

2727
@staticmethod
28-
def resolve_key(obj):
28+
def resolve_key(obj: CommitteeModel) -> str:
2929
"""Resolve key."""
3030
return obj.nest_key
3131

backend/apps/api/rest/v0/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ProjectBase(Schema):
2727
updated_at: datetime
2828

2929
@staticmethod
30-
def resolve_key(obj):
30+
def resolve_key(obj: ProjectModel) -> str:
3131
"""Resolve key."""
3232
return obj.nest_key
3333

0 commit comments

Comments
 (0)