File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 99from django .urls import reverse
1010from django .utils .translation import gettext_lazy as _
1111from django .views .generic import View
12- from extras .choices import CustomFieldUIVisibleChoices
12+ from extras .choices import CustomFieldTypeChoices , CustomFieldUIVisibleChoices
1313from extras .forms import JournalEntryForm
1414from extras .models import JournalEntry
1515from extras .tables import JournalEntryTable
@@ -189,6 +189,16 @@ def _get_dependent_objects(self, obj):
189189 dependent_objects = super ()._get_dependent_objects (obj )
190190 model = obj .get_model ()
191191 dependent_objects [model ] = list (model .objects .all ())
192+
193+ # Find CustomObjectTypeFields that reference this CustomObjectType
194+ referencing_fields = CustomObjectTypeField .objects .filter (
195+ related_object_type = obj .content_type
196+ )
197+
198+ # Add the CustomObjectTypeFields that reference this CustomObjectType
199+ if referencing_fields .exists ():
200+ dependent_objects [CustomObjectTypeField ] = list (referencing_fields )
201+
192202 return dependent_objects
193203
194204
You can’t perform that action at this time.
0 commit comments