2018-05-21 22:23:53 +02:00
|
|
|
from django import forms
|
|
|
|
|
2018-05-22 10:13:51 +02:00
|
|
|
from manuels.models import Book, SuppliesRequirement
|
2018-05-21 22:23:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
class AddBookForm(forms.ModelForm):
|
|
|
|
class Meta:
|
|
|
|
model = Book
|
2018-05-31 08:16:22 +02:00
|
|
|
fields = ['teacher', 'level', 'field', 'no_book', 'title', 'authors', 'editor', 'publication_year',
|
|
|
|
'isbn', 'price', 'previously_acquired', 'comments', 'add_another']
|
2018-05-21 23:12:35 +02:00
|
|
|
|
2018-05-22 10:13:51 +02:00
|
|
|
add_another = forms.BooleanField(label='Ajouter un autre livre', required=False, initial=True)
|
2018-05-31 08:16:22 +02:00
|
|
|
no_book = forms.BooleanField(label='Pas de livre pour cette classe/matière', required=False, initial=False)
|
2018-05-22 10:13:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
class AddSuppliesForm(forms.ModelForm):
|
|
|
|
class Meta:
|
|
|
|
model = SuppliesRequirement
|
2018-05-30 18:06:27 +02:00
|
|
|
exclude = ['done']
|
2018-05-22 10:13:51 +02:00
|
|
|
|
|
|
|
add_another = forms.BooleanField(label="Ajouter d'autres fournitures", required=False, initial=True)
|