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

Use FieldSet instances for all forms

This commit is contained in:
Jeremy Stretch
2024-03-18 15:08:28 -04:00
parent 3b28e8e615
commit 72d3c17b48
35 changed files with 800 additions and 757 deletions

View File

@ -33,10 +33,11 @@ class TabbedGroups:
"""
Two or more groups of fields (FieldSets) arranged under tabs among which the user can navigate.
"""
def __init__(self, *groups):
self.groups = [
FieldSet(*group, name=name) for name, *group in groups
]
def __init__(self, *fieldsets):
for fs in fieldsets:
if not fs.name:
raise ValueError(f"Grouped fieldset {fs} must have a name.")
self.groups = fieldsets
# Initialize a random ID for the group (for tab selection)
self.id = ''.join(