|
|
@ -108,12 +108,19 @@ class EditOptionalTopologieForm(ModelForm): |
|
|
"""Form used to edit the configuration of switches.""" |
|
|
"""Form used to edit the configuration of switches.""" |
|
|
|
|
|
|
|
|
automatic_provision_switchs = forms.ModelMultipleChoiceField( |
|
|
automatic_provision_switchs = forms.ModelMultipleChoiceField( |
|
|
Switch.objects.all(), required=False |
|
|
Switch.objects.all(), |
|
|
|
|
|
required=False, |
|
|
|
|
|
widget=AutocompleteMultipleModelMixin(url="/topologie/switch-autocomplete"), |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
class Meta: |
|
|
class Meta: |
|
|
model = OptionalTopologie |
|
|
model = OptionalTopologie |
|
|
fields = "__all__" |
|
|
fields = "__all__" |
|
|
|
|
|
widgets = { |
|
|
|
|
|
"switchs_ip_type": AutocompleteModelMixin( |
|
|
|
|
|
url="/machines/iptype-autocomplete", |
|
|
|
|
|
), |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
def __init__(self, *args, **kwargs): |
|
|
prefix = kwargs.pop("prefix", self.Meta.model.__name__) |
|
|
prefix = kwargs.pop("prefix", self.Meta.model.__name__) |
|
|
|