From 78cb528fe7cf269a2e0994a090a3610674a5e551 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 2 Jun 2018 09:58:57 +0200 Subject: [PATCH] Use text inputs instead of text areas for title and authors. Close #7 --- manuels/forms.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manuels/forms.py b/manuels/forms.py index 45a2957..4e36b31 100644 --- a/manuels/forms.py +++ b/manuels/forms.py @@ -11,6 +11,11 @@ class EditBookForm(forms.ModelForm): no_book = forms.BooleanField(label='Pas de livre pour cette classe/matière', required=False, initial=False) + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.fields['title'].widget = forms.TextInput() + self.fields['authors'].widget = forms.TextInput() + class AddBookForm(EditBookForm): class Meta(EditBookForm.Meta):