mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
48 lines
1.1 KiB
Python
48 lines
1.1 KiB
Python
from django import forms
|
|
|
|
from utilities.forms import BootstrapMixin
|
|
|
|
OBJ_TYPE_CHOICES = (
|
|
('', 'All Objects'),
|
|
('Circuits', (
|
|
('provider', 'Providers'),
|
|
('circuit', 'Circuits'),
|
|
)),
|
|
('DCIM', (
|
|
('site', 'Sites'),
|
|
('rack', 'Racks'),
|
|
('rackgroup', 'Rack Groups'),
|
|
('devicetype', 'Device types'),
|
|
('device', 'Devices'),
|
|
('virtualchassis', 'Virtual Chassis'),
|
|
('cable', 'Cables'),
|
|
('powerfeed', 'Power Feeds'),
|
|
)),
|
|
('IPAM', (
|
|
('vrf', 'VRFs'),
|
|
('aggregate', 'Aggregates'),
|
|
('prefix', 'Prefixes'),
|
|
('ipaddress', 'IP addresses'),
|
|
('vlan', 'VLANs'),
|
|
)),
|
|
('Secrets', (
|
|
('secret', 'Secrets'),
|
|
)),
|
|
('Tenancy', (
|
|
('tenant', 'Tenants'),
|
|
)),
|
|
('Virtualization', (
|
|
('cluster', 'Clusters'),
|
|
('virtualmachine', 'Virtual machines'),
|
|
)),
|
|
)
|
|
|
|
|
|
class SearchForm(BootstrapMixin, forms.Form):
|
|
q = forms.CharField(
|
|
label='Search'
|
|
)
|
|
obj_type = forms.ChoiceField(
|
|
choices=OBJ_TYPE_CHOICES, required=False, label='Type'
|
|
)
|