diff options
author | Filipp Lepalaan <filipp@mac.com> | 2021-05-15 15:01:40 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2021-05-15 15:01:40 +0300 |
commit | 08155df685f2d52cee1ec3ef0761e794f36a1bc6 (patch) | |
tree | 90713457be7c78a5f76a1a53f785d2866c3556a4 /servo/forms | |
parent | 3af675351bbc1c2a8a652049d12e7b699744d730 (diff) | |
download | Servo-08155df685f2d52cee1ec3ef0761e794f36a1bc6.tar.gz Servo-08155df685f2d52cee1ec3ef0761e794f36a1bc6.tar.bz2 Servo-08155df685f2d52cee1ec3ef0761e794f36a1bc6.zip |
Fix adding device tags
Diffstat (limited to 'servo/forms')
-rw-r--r-- | servo/forms/devices.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/servo/forms/devices.py b/servo/forms/devices.py index 8d41c02..a95715e 100644 --- a/servo/forms/devices.py +++ b/servo/forms/devices.py @@ -33,8 +33,7 @@ class DeviceSearchForm(forms.Form): def __init__(self, *args, **kwargs): super(DeviceSearchForm, self).__init__(*args, **kwargs) - self.fields['description'] = AutocompleteCharField( - '/api/device_models/', + self.fields['description'] = AutocompleteCharField('/api/device_models/', max_length=128, required=False, label=_('Description contains') @@ -42,17 +41,19 @@ class DeviceSearchForm(forms.Form): class DeviceForm(forms.ModelForm): + """The form for editing devices in the /devices view""" + """ + tags = forms.ModelMultipleChoiceField( + queryset=Tag.objects.filter(type='device'), + required=False + ) + """ class Meta: model = Device exclude = ('spec', 'customers', 'files', 'image_url', 'exploded_view_url', 'manual_url', ) widgets = {'purchased_on': DatepickerInput()} - tags = forms.ModelMultipleChoiceField( - queryset=Tag.objects.filter(type='device'), - required=False - ) - class DeviceUploadForm(forms.Form): datafile = forms.FileField( |