Skip to content

Commit

Permalink
Merge pull request #24 from KiraPC/issue-23
Browse files Browse the repository at this point in the history
added multi parents inheritance
  • Loading branch information
KiraPC authored Feb 22, 2022
2 parents e105701 + 7a7d99e commit 4d10554
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fastapi_router_controller/lib/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ def add_resource(self, cls):
raise MultipleResourceException()

# check if cls (Resource) was exteded from another
if hasattr(cls, Controller.RC_KEY):
self.__get_parent_routes(cls.__router__)
for base in cls.__bases__:
if hasattr(base, Controller.RC_KEY):
self.__get_parent_routes(base.__router__)

setattr(cls, Controller.RC_KEY, self.router)
setattr(self, Controller.RESOURCE_CLASS_KEY, cls)
Expand Down

0 comments on commit 4d10554

Please sign in to comment.