X-Git-Url: https://git.auf.org/?p=auf_django_emploi.git;a=blobdiff_plain;f=auf%2Fdjango%2Femploi%2Fforms.py;h=02e8b979045912e755de3ef5cfb36c6215004f9a;hp=7f963cc9e64479ae370a105b25aa5435b611f9a4;hb=efd28a79de35fa271375f775e003073fb983d71c;hpb=449c527a80b0c1941abd4ae2894179ebdcceecbc diff --git a/auf/django/emploi/forms.py b/auf/django/emploi/forms.py index 7f963cc..02e8b97 100644 --- a/auf/django/emploi/forms.py +++ b/auf/django/emploi/forms.py @@ -7,21 +7,24 @@ from django.forms import ModelForm from captcha.fields import CaptchaField -from auf.django.emploi import models as emploi +from models import * ################################################################################ # OFFRE EMPLOI ################################################################################ -class CandidatPieceForm(inlineformset_factory(emploi.Candidat, - emploi.CandidatPiece)): - nom = forms.MultipleChoiceField(choices=emploi.TYPE_PIECE_CHOICES, +class CandidatPieceForm(inlineformset_factory(Candidat, + CandidatPiece)): + nom = forms.MultipleChoiceField(choices=TYPE_PIECE_CHOICES, widget=CheckboxSelectMultiple) + + class PostulerOffreEmploiForm(ModelForm): captcha = CaptchaField() + action = "http://127.0.0.1:8000/api/candidat_add/" def __init__(self, *args, **kwargs): - self.offre_emploi = kwargs.pop('offre_emploi') + self.offre_emploi = kwargs.pop('offre_id') super(PostulerOffreEmploiForm, self).__init__(*args, **kwargs) def save(self, *args, **kwargs): @@ -33,7 +36,7 @@ class PostulerOffreEmploiForm(ModelForm): return postulation class Meta: - model = emploi.Candidat + model = Candidat exclude = ('actif', 'offre_emploi',) fields = ('nom', 'prenom', 'genre', 'nationalite', 'situation_famille', 'nombre_dependant', 'niveau_diplome', 'employeur_actuel',