From faac45dec52354e254f32e0590353b7429cad8e3 Mon Sep 17 00:00:00 2001 From: chirac Date: Mon, 28 Dec 2020 20:01:39 +0100 Subject: [PATCH] Fix switchs management autocomplete form --- preferences/forms.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/preferences/forms.py b/preferences/forms.py index fdc752ab..a7d03162 100644 --- a/preferences/forms.py +++ b/preferences/forms.py @@ -108,12 +108,19 @@ class EditOptionalTopologieForm(ModelForm): """Form used to edit the configuration of switches.""" automatic_provision_switchs = forms.ModelMultipleChoiceField( - Switch.objects.all(), required=False + Switch.objects.all(), + required=False, + widget=AutocompleteMultipleModelMixin(url="/topologie/switch-autocomplete"), ) class Meta: model = OptionalTopologie fields = "__all__" + widgets = { + "switchs_ip_type": AutocompleteModelMixin( + url="/machines/iptype-autocomplete", + ), + } def __init__(self, *args, **kwargs): prefix = kwargs.pop("prefix", self.Meta.model.__name__)