Version bump 1.2
[auf_django_emploi.git] / auf / django / emploi / forms.py
... / ...
CommitLineData
1# -*- encoding: utf-8 -*-
2
3from django import forms
4from django.forms.models import inlineformset_factory
5from django.forms.widgets import CheckboxSelectMultiple
6from django.forms import ModelForm
7
8from captcha.fields import CaptchaField
9
10from models import *
11
12################################################################################
13# OFFRE EMPLOI
14################################################################################
15class CandidatPieceForm(inlineformset_factory(Candidat,
16 CandidatPiece)):
17 nom = forms.MultipleChoiceField(choices=TYPE_PIECE_CHOICES,
18 widget=CheckboxSelectMultiple)
19
20
21
22POSTULER_FORM_EXCLUDES = ('actif', 'offre_emploi',)
23POSTULER_FORM_FIELDS = ('nom', 'prenom', 'genre', 'nationalite', 'situation_famille',
24 'nombre_dependant', 'niveau_diplome', 'employeur_actuel',
25 'poste_actuel', 'domaine_professionnel', 'telephone',
26 'email', 'adresse', 'ville', 'code_postal', 'etat_province',
27 'pays', )
28
29class NoCaptchaPostulerOffreEmploiForm(ModelForm):
30 class Meta:
31 model = Candidat
32 exclude = POSTULER_FORM_EXCLUDES
33 fields = POSTULER_FORM_FIELDS
34
35class PostulerOffreEmploiForm(ModelForm):
36 captcha = CaptchaField()
37
38 class Meta:
39 model = Candidat
40 exclude = POSTULER_FORM_EXCLUDES
41 fields = POSTULER_FORM_FIELDS + ('captcha', )