from django.forms.models import BaseInlineFormSet
from django.core.mail import send_mail
+from datamaster_modeles.models import Employe, Implantation, Region
from tinymce.widgets import TinyMCE
from captcha.fields import CaptchaField
from recrutement import models as recr
from auf.django.emploi import forms as emploi
from project.rh import models as rh
+from project.dae.utils import get_employe_from_user as get_emp
################################################################################
# EVALUATION
pass
class OffreEmploiForm(ModelForm):
- poste = ModelChoiceField(queryset=rh.Poste.objects.all())
-
- class Meta:
- model = recr.OffreEmploi
-
- def save(self, *args, **kwargs):
- kwargs2 = kwargs.copy()
- kwargs2['commit'] = False
- offre = super(OffreEmploiForm, self).save(*args, **kwargs2)
- offre.poste = self.cleaned_data.get("poste").id
- offre.poste_nom = self.cleaned_data.get("poste").nom
- if 'commit' not in kwargs or kwargs['commit']:
- offre.save()
- return offre
+ #poste = ModelChoiceField(queryset=rh.Poste.objects.all())
+
+ #class Meta:
+ # model = recr.OffreEmploi
+
+ #def __init__(self, *args, **kwargs):
+ # super(OffreEmploiForm, self).__init__(*args, **kwargs)
+ #
+ #def save(self, *args, **kwargs):
+ # kwargs2 = kwargs.copy()
+ # kwargs2['commit'] = False
+ # offre = super(OffreEmploiForm, self).save(*args, **kwargs2)
+ # offre.poste = self.cleaned_data.get("poste").id
+ # offre.poste_nom = self.cleaned_data.get("poste").nom
+ # if 'commit' not in kwargs or kwargs['commit']:
+ # offre.save()
+ # return offre
def clean(self):
cleaned_data = self.cleaned_data
if date_limite > debut_affectation:
raise forms.ValidationError("La date limite ne peut pas être \
supérieure à la date d'affection.")
-
- """if date_limite < datetime.date.today() or \
- debut_affectation < datetime.date.today():
- raise forms.ValidationError("La date limite et/ou la date \
- d'affection doivent être supérieures à la date d'aujourdhui.")
- """
return cleaned_data
################################################################################