Use custom selects when possible. #30

This commit is contained in:
Gabriel Augendre 2018-06-14 00:07:29 +02:00
parent 7cc01833d6
commit efcee5b07f

View file

@ -21,6 +21,9 @@ class EditBookForm(forms.ModelForm):
self.fields['title'].widget = forms.TextInput()
self.fields['authors'].widget = forms.TextInput()
self.fields['comments'].widget.attrs.update(rows=3)
self.fields['teacher'].widget.attrs.update({'class': 'custom-select'})
self.fields['editor'].widget.attrs.update({'class': 'custom-select'})
self.fields['previously_acquired'].widget.attrs.update({'class': 'custom-select'})
def clean(self):
editor = self.cleaned_data['editor']
@ -63,6 +66,8 @@ class EditSuppliesForm(forms.ModelForm):
super().__init__(*args, **kwargs)
self.fields['fields'].widget.attrs.update(rows=3)
self.fields['supplies'].widget.attrs.update(rows=3)
self.fields['teacher'].widget.attrs.update({'class': 'custom-select'})
self.fields['level'].widget.attrs.update({'class': 'custom-select'})
class AddSuppliesForm(EditSuppliesForm):