Skip to content

Commit

Permalink
fix(generic): add uri_set to genericModel
Browse files Browse the repository at this point in the history
  • Loading branch information
sennierer committed Dec 17, 2024
1 parent bc40eda commit 02a60bd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apis_core/generic/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,14 @@ def duplicate(self):
return newobj

duplicate.alters_data = True

def uri_set(self):
ct = ContentType.objects.get_for_model(self)
return (
ContentType.objects.get(app_label="apis_metainfo", model="uri")
.model_class()
.objects.filter(content_type=ct, object_id=self.id)
.all()
)


0 comments on commit 02a60bd

Please sign in to comment.