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

Move fieldsets out of Meta for model forms

This commit is contained in:
jeremystretch
2022-01-31 15:52:36 -05:00
parent cf3ca5a661
commit ccb3a75281
11 changed files with 206 additions and 170 deletions

View File

@@ -27,15 +27,16 @@ class ProviderForm(NetBoxModelForm):
required=False
)
fieldsets = (
('Provider', ('name', 'slug', 'asn', 'tags')),
('Support Info', ('account', 'portal_url', 'noc_contact', 'admin_contact')),
)
class Meta:
model = Provider
fields = [
'name', 'slug', 'asn', 'account', 'portal_url', 'noc_contact', 'admin_contact', 'comments', 'tags',
]
fieldsets = (
('Provider', ('name', 'slug', 'asn', 'tags')),
('Support Info', ('account', 'portal_url', 'noc_contact', 'admin_contact')),
)
widgets = {
'noc_contact': SmallTextarea(
attrs={'rows': 5}
@@ -63,14 +64,15 @@ class ProviderNetworkForm(NetBoxModelForm):
required=False
)
fieldsets = (
('Provider Network', ('provider', 'name', 'service_id', 'description', 'tags')),
)
class Meta:
model = ProviderNetwork
fields = [
'provider', 'name', 'service_id', 'description', 'comments', 'tags',
]
fieldsets = (
('Provider Network', ('provider', 'name', 'service_id', 'description', 'tags')),
)
class CircuitTypeForm(NetBoxModelForm):
@@ -100,16 +102,17 @@ class CircuitForm(TenancyForm, NetBoxModelForm):
required=False
)
fieldsets = (
('Circuit', ('provider', 'cid', 'type', 'status', 'install_date', 'commit_rate', 'description', 'tags')),
('Tenancy', ('tenant_group', 'tenant')),
)
class Meta:
model = Circuit
fields = [
'cid', 'type', 'provider', 'status', 'install_date', 'commit_rate', 'description', 'tenant_group', 'tenant',
'comments', 'tags',
]
fieldsets = (
('Circuit', ('provider', 'cid', 'type', 'status', 'install_date', 'commit_rate', 'description', 'tags')),
('Tenancy', ('tenant_group', 'tenant')),
)
help_texts = {
'cid': "Unique circuit ID",
'commit_rate': "Committed rate",