Version bump 1.2
[auf_django_emploi.git] / auf / django / emploi / forms.py
CommitLineData
184b84de
NBV
1# -*- encoding: utf-8 -*-
2
184b84de 3from django import forms
184b84de
NBV
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
36b8eabb 10from models import *
184b84de
NBV
11
12################################################################################
13# OFFRE EMPLOI
14################################################################################
36b8eabb
NBV
15class CandidatPieceForm(inlineformset_factory(Candidat,
16 CandidatPiece)):
17 nom = forms.MultipleChoiceField(choices=TYPE_PIECE_CHOICES,
184b84de
NBV
18 widget=CheckboxSelectMultiple)
19
3d78c976
NBV
20
21
77dc3c2f
OL
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', )
184b84de 28
77dc3c2f
OL
29class NoCaptchaPostulerOffreEmploiForm(ModelForm):
30 class Meta:
31 model = Candidat
32 exclude = POSTULER_FORM_EXCLUDES
33 fields = POSTULER_FORM_FIELDS
184b84de 34
77dc3c2f
OL
35class PostulerOffreEmploiForm(ModelForm):
36 captcha = CaptchaField()
184b84de
NBV
37
38 class Meta:
36b8eabb 39 model = Candidat
77dc3c2f
OL
40 exclude = POSTULER_FORM_EXCLUDES
41 fields = POSTULER_FORM_FIELDS + ('captcha', )