fix unicode for QBE introspection
[auf_rh_dae.git] / project / rh / forms.py
1 # -*- encoding: utf-8 -*-
2
3 from django import forms
4 from models import Dossier, Contrat
5
6
7 class FormDate(object):
8
9 def clean_date_fin(self):
10 date_fin = self.cleaned_data['date_fin']
11 if date_fin is None:
12 return date_fin
13 date_debut = self.cleaned_data['date_debut']
14 if date_fin < date_debut:
15 raise forms.ValidationError(u"La date de fin est antérieure à la date de début")
16 return date_fin
17
18 class DossierForm(forms.ModelForm, FormDate):
19
20 class Model:
21 model = Dossier
22
23 class ContratForm(forms.ModelForm, FormDate):
24
25 class Model:
26 model = Contrat