From 63a40311bab6a388aa776cff0f8b58f10098e08e Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Fri, 29 Nov 2024 10:22:19 +0100 Subject: [PATCH] feat(apis_relations): update GenericTripleForm to work with generic uri 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. --- apis_core/apis_relations/forms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apis_core/apis_relations/forms.py b/apis_core/apis_relations/forms.py index 2e713dedb..85046c8a9 100644 --- a/apis_core/apis_relations/forms.py +++ b/apis_core/apis_relations/forms.py @@ -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"db {str(entity_instance_other)}",