Skip to content

Commit

Permalink
added multi parents inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
KiraPC committed Feb 22, 2022
1 parent e105701 commit 7a7d99e
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 7a7d99e

Please sign in to comment.