Skip to content

Commit

Permalink
feat(apis_entities): add method for retrieving merge url of instance
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Apr 8, 2024
1 parent 0a48a72 commit e4c0cd9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apis_core/apis_entities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ def get_duplicate_url(self):
kwargs={"contenttype": entity, "pk": self.id},
)

def get_merge_url(self):
entity = self.__class__.__name__.lower()
return reverse(
"apis_core:apis_entities:generic_entities_merge_view",
kwargs={"contenttype": entity, "pk": self.id},
)

def merge_charfield(self, other, field):
res = getattr(self, field.name)
if not field.choices:
Expand Down

0 comments on commit e4c0cd9

Please sign in to comment.