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

Update object edit template to use fieldsets where possible

This commit is contained in:
Jeremy Stretch
2021-02-25 13:51:48 -05:00
parent 2a517cde9f
commit 42e82f0ead
27 changed files with 75 additions and 659 deletions

View File

@ -104,6 +104,10 @@ class ClusterForm(BootstrapMixin, TenancyForm, CustomFieldModelForm):
fields = (
'name', 'type', 'group', 'tenant', 'region', 'site', 'comments', 'tags',
)
fieldsets = (
('Cluster', ('name', 'type', 'group', 'region', 'site')),
('Tenancy', ('tenant_group', 'tenant')),
)
class ClusterCSVForm(CustomFieldModelCSVForm):
@ -321,6 +325,13 @@ class VirtualMachineForm(BootstrapMixin, TenancyForm, CustomFieldModelForm):
'name', 'status', 'cluster_group', 'cluster', 'role', 'tenant_group', 'tenant', 'platform', 'primary_ip4',
'primary_ip6', 'vcpus', 'memory', 'disk', 'comments', 'tags', 'local_context_data',
]
fieldsets = (
('Virtual Machine', ('name', 'role', 'status')),
('Cluster', ('cluster_group', 'cluster')),
('Management', ('platform', 'primary_ip4', 'primary_ip6')),
('Resources', ('vcpus', 'memory', 'disk')),
('Config Context', ('local_context_data',)),
)
help_texts = {
'local_context_data': "Local config context data overwrites all sources contexts in the final rendered "
"config context",