@@ -368,8 +368,8 @@ def get_form(self, model):
368
368
"Meta" : meta ,
369
369
"__module__" : "database.forms" ,
370
370
"_errors" : None ,
371
- "custom_fields " : {},
372
- "custom_field_groups " : {},
371
+ "custom_object_type_fields " : {},
372
+ "custom_object_type_field_groups " : {},
373
373
}
374
374
375
375
for field in self .object .custom_object_type .fields .all ().order_by ('group_name' , 'weight' , 'name' ):
@@ -379,13 +379,13 @@ def get_form(self, model):
379
379
attrs [field_name ] = field_type .get_annotated_form_field (field )
380
380
381
381
# Annotate the field in the list of CustomField form fields
382
- attrs ["custom_fields " ][field_name ] = field
382
+ attrs ["custom_object_type_fields " ][field_name ] = field
383
383
384
384
# Group fields by group_name (similar to NetBox custom fields)
385
385
group_name = field .group_name or None # Use None for ungrouped fields
386
- if group_name not in attrs ["custom_field_groups " ]:
387
- attrs ["custom_field_groups " ][group_name ] = []
388
- attrs ["custom_field_groups " ][group_name ].append (field_name )
386
+ if group_name not in attrs ["custom_object_type_field_groups " ]:
387
+ attrs ["custom_object_type_field_groups " ][group_name ] = []
388
+ attrs ["custom_object_type_field_groups " ][group_name ].append (field_name )
389
389
390
390
except NotImplementedError :
391
391
print (f"get_form: { field .name } field is not supported" )
@@ -394,8 +394,8 @@ def get_form(self, model):
394
394
def custom_init (self , * args , ** kwargs ):
395
395
super (form_class , self ).__init__ (* args , ** kwargs )
396
396
# Set the grouping info as instance attributes from the outer scope
397
- self .custom_fields = attrs ["custom_fields " ]
398
- self .custom_field_groups = attrs ["custom_field_groups " ]
397
+ self .custom_object_type_fields = attrs ["custom_object_type_fields " ]
398
+ self .custom_object_type_field_groups = attrs ["custom_object_type_field_groups " ]
399
399
400
400
attrs ["__init__" ] = custom_init
401
401
0 commit comments