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

Added views to add/remove hosts to/from clusters

This commit is contained in:
Jeremy Stretch
2017-08-21 16:53:36 -04:00
parent 5930a64203
commit 4587aba1d4
8 changed files with 275 additions and 12 deletions

View File

@@ -187,6 +187,10 @@ class APISelect(SelectWithDisabled):
self.attrs['disabled-indicator'] = disabled_indicator
class APISelectMultiple(APISelect):
allow_multiple_selected = True
class Livesearch(forms.TextInput):
"""
A text widget that carries a few extra bits of data for use in AJAX-powered autocomplete search
@@ -385,6 +389,15 @@ class ChainedModelChoiceField(forms.ModelChoiceField):
super(ChainedModelChoiceField, self).__init__(*args, **kwargs)
class ChainedModelMultipleChoiceField(forms.ModelMultipleChoiceField):
"""
See ChainedModelChoiceField
"""
def __init__(self, chains=None, *args, **kwargs):
self.chains = chains
super(ChainedModelMultipleChoiceField, self).__init__(*args, **kwargs)
class SlugField(forms.SlugField):
def __init__(self, slug_source='name', *args, **kwargs):