Skip to content

Commit

Permalink
feat(apis_relations): update GenericTripleForm to work with generic uri
Browse files Browse the repository at this point in the history
The `Uri` model now uses a generic foreign key instead of the direct
foreign key to the `RootObject`. This commit updates all occurences
of `root_object` to instead use the generic foreign key.
  • Loading branch information
b1rger committed Dec 20, 2024
1 parent e86399f commit 63a4031
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apis_core/apis_relations/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ def load_subj_obj_prop(
self.fields["property"].initial = property_initial_value
self.fields["property"].choices = [property_initial_value]

content_type = ContentType.objects.get_for_model(entity_instance_other)
other_entity_initial_value = (
str(
Uri.objects.filter(
root_object=entity_instance_other,
Uri.object.filter(
content_type=content_type, object_id=entity_instance_other.id
).first()
),
f"<span ><small>db</small> {str(entity_instance_other)}</span>",
Expand Down

0 comments on commit 63a4031

Please sign in to comment.