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 9
9
from django .urls import reverse
10
10
from django .utils .translation import gettext_lazy as _
11
11
from django .views .generic import View
12
- from extras .choices import CustomFieldUIVisibleChoices
12
+ from extras .choices import CustomFieldTypeChoices , CustomFieldUIVisibleChoices
13
13
from extras .forms import JournalEntryForm
14
14
from extras .models import JournalEntry
15
15
from extras .tables import JournalEntryTable
@@ -189,6 +189,16 @@ def _get_dependent_objects(self, obj):
189
189
dependent_objects = super ()._get_dependent_objects (obj )
190
190
model = obj .get_model ()
191
191
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
+
192
202
return dependent_objects
193
203
194
204
You can’t perform that action at this time.
0 commit comments