1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #9829: Arrange custom fields by group when editing objects

This commit is contained in:
jeremystretch
2022-07-26 12:41:51 -04:00
parent d442f8fd60
commit 466931d2fb
5 changed files with 23 additions and 24 deletions

View File

@ -19,6 +19,7 @@ class CustomFieldsMixin:
def __init__(self, *args, **kwargs):
self.custom_fields = {}
self.custom_field_groups = {}
super().__init__(*args, **kwargs)
@ -58,3 +59,6 @@ class CustomFieldsMixin:
# Annotate the field in the list of CustomField form fields
self.custom_fields[field_name] = customfield
if customfield.group_name not in self.custom_field_groups:
self.custom_field_groups[customfield.group_name] = []
self.custom_field_groups[customfield.group_name].append(field_name)