Skip to content

Commit

Permalink
fix: allow overriding Crudl class methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jhassine committed Nov 22, 2024
1 parent d0db402 commit 24bc2eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions django_ninja_crudl/crudl.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,11 @@ def get_many(
qs = qs.values(*all_fields)
return qs

# Add (overwrite if necessary) all dct attributes to the CrudlBase class
for attr_name, attr_value in dct.items():
if not attr_name.startswith("__"):
setattr(CrudlBase, attr_name, attr_value)

for attr_name, attr_value in CrudlBase.__dict__.items():
if not attr_name.startswith("__"):
dct[attr_name] = attr_value
Expand Down

0 comments on commit 24bc2eb

Please sign in to comment.