1 # -*- encoding: utf-8 -*-
3 from django
import forms
4 from django
.forms
.models
import inlineformset_factory
5 from django
.forms
.widgets
import CheckboxSelectMultiple
6 from django
.forms
import ModelForm
8 from captcha
.fields
import CaptchaField
12 ################################################################################
14 ################################################################################
15 class CandidatPieceForm(inlineformset_factory(Candidat
,
17 nom
= forms
.MultipleChoiceField(choices
=TYPE_PIECE_CHOICES
,
18 widget
=CheckboxSelectMultiple
)
20 def __init__(self
, *args
, **kwargs
):
21 super(CandidatPieceForm
, self
).__init__(*args
, **kwargs
)
23 def save(self
, *args
, **kwargs
):
24 super(CandidatPieceForm
, self
).save(*args
, **kwargs
)
27 POSTULER_FORM_EXCLUDES
= ('actif', 'offre_emploi',)
28 POSTULER_FORM_FIELDS
= ('nom', 'prenom', 'genre', 'nationalite', 'situation_famille',
29 'nombre_dependant', 'niveau_diplome', 'employeur_actuel',
30 'poste_actuel', 'domaine_professionnel', 'telephone',
31 'email', 'adresse', 'ville', 'code_postal', 'etat_province',
34 class NoCaptchaPostulerOffreEmploiForm(ModelForm
):
37 exclude
= POSTULER_FORM_EXCLUDES
38 fields
= POSTULER_FORM_FIELDS
40 class PostulerOffreEmploiForm(ModelForm
):
41 captcha
= CaptchaField()
45 exclude
= POSTULER_FORM_EXCLUDES
46 fields
= POSTULER_FORM_FIELDS
+ ('captcha', )