fix unicode for QBE introspection
[auf_rh_dae.git] / project / rh / forms.py
CommitLineData
84cbb4c5
OL
1# -*- encoding: utf-8 -*-
2
3from django import forms
4from models import Dossier, Contrat
5
6
7class 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:
3f5f3898 15 raise forms.ValidationError(u"La date de fin est antérieure à la date de début")
84cbb4c5
OL
16 return date_fin
17
18class DossierForm(forms.ModelForm, FormDate):
19
20 class Model:
21 model = Dossier
22
23class ContratForm(forms.ModelForm, FormDate):
24
25 class Model:
26 model = Contrat