Revision 23af777c
Added by Serghei Mihai almost 11 years ago
calebasse/dossiers/forms.py | ||
---|---|---|
83 | 83 |
return self.cleaned_data['date_selected'] |
84 | 84 |
|
85 | 85 |
class NewPatientRecordForm(ModelForm): |
86 |
date_selected = forms.DateField(label=u"Date de contact", initial=date.today(), localize=True)
|
|
86 |
date_selected = forms.DateField(label=u"Date de contact", localize=True) |
|
87 | 87 |
|
88 | 88 |
def __init__(self, *args, **kwargs): |
89 | 89 |
super(NewPatientRecordForm, self).__init__(*args, **kwargs) |
90 | 90 |
self.fields['first_name'].required = True |
91 |
self.fields['date_selected'].initial = date.today() |
|
91 | 92 |
|
92 | 93 |
class Meta: |
93 | 94 |
model = PatientRecord |
Also available in: Unified diff
dossier: date widget initialized on form instanciation
Closes #4271