ernestophone.ens.fr/calendrier/forms.py

20 lines
838 B
Python
Raw Normal View History

2015-04-13 18:56:43 +02:00
from django import forms
2015-07-22 22:08:59 +02:00
from calendrier.models import Event, Participants
2015-04-13 18:56:43 +02:00
class EventForm(forms.ModelForm):
2015-07-22 22:08:59 +02:00
sendmail = forms.BooleanField(initial=False, label="Envoyer l'invitation à la liste fanfare")
message = forms.CharField(max_length=2000, widget=forms.Textarea(attrs={"placeholder":"Remplir ici pour remplacer le mail automatique"}), required=False)
2015-04-13 18:56:43 +02:00
class Meta:
model = Event
widgets = {
'description': forms.Textarea(attrs={"placeholder":"facultatif"}),
'date': forms.TextInput(attrs={"placeholder": 'jj/mm/aaaa'}),
'debut': forms.TextInput(attrs={"placeholder": 'hh:mm'}),
'fin': forms.TextInput(attrs={"placeholder": 'hh:mm facultatif'})
}
2015-07-22 22:08:59 +02:00
class ParticipantsForm(forms.ModelForm):
class Meta:
model = Participants
fields = ('reponse', )