Correction related_name dans models.
TEMPLATE_DEBUG=DEBUG
# Décommentez ces lignes pour activer la debugtoolbar
-#INTERNAL_IPS = ('127.0.0.1',)
-#INSTALLED_APPS += ('debug_toolbar',)
-#MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
+INTERNAL_IPS = ('127.0.0.1',)
+INSTALLED_APPS += ('debug_toolbar',)
+MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
AUTH_PASSWORD_REQUIRED = False
from recrutement.models import *
class OffreEmploiAdmin(admin.ModelAdmin):
- pass
+ date_hierarchy = 'date_creation'
+ list_display = ('nom', 'resume', 'date_limite',)
+ list_filter = ('region',)
class CandidatAdmin(admin.ModelAdmin):
- pass
+ date_hierarchy = 'date_creation'
+ list_display = ('nom', 'prenom', 'offre_emploi','statut',)
+ fieldsets = (
+ ('Informations personnelles', {
+ 'fields': ('prenom','nom','genre', 'nationalite', 'date_naissance',
+ 'situation_famille', 'nombre_dependant',)
+ }),
+ ('Adresse', {
+ 'fields': ('adresse', 'ville', 'etat_province', 'pays', )
+ }),
+ ('Informations professionnelles', {
+ 'fields': ('offre_emploi','niveau_diplome','employeur_actuel','poste_actuel',
+ 'domaine_professionnel',)
+ }),
+ ('Options avancées', {
+ 'classes': ('collapse',),
+ 'fields': ('actif', 'statut', )
+ }),
+ )
class CandidatPieceAdmin(admin.ModelAdmin):
pass
)
class Candidat(Metadata):
- # TODO : Automatiser le statut à la création à Nouveau
+ # TODO : Automatiser le statut à la création à Nouveau
+ statut = models.CharField(max_length=4,
+ choices=STATUT_CHOICES)
offre_emploi = models.ForeignKey('OffreEmploi', db_column='offre_emploi',
- related_name='candidats')
+ related_name='+')
prenom = models.CharField(max_length=255)
nom = models.CharField(max_length=255)
genre = models.CharField(max_length=1, choices=GENRE_CHOICES)
nationalite = models.ForeignKey(ref.Pays,
db_column='nationalite',
- related_name='candidat_nationalite')
+ related_name='+')
date_naissance = models.DateField(verbose_name="Date de naissance")
situation_famille = models.CharField(max_length=1,
choices=SITUATION_CHOICES)
etat_province = models.CharField(max_length=255,
verbose_name="État/Province")
pays = models.ForeignKey(ref.Pays, db_column='pays',
- related_name='candidats')
-
- statut = models.CharField(max_length=4,
- choices=STATUT_CHOICES)
+ related_name='+')
def __unicode__(self):
return '%s %s [%s]' % (self.prenom, self.nom, self.id)
class CandidatEvaluation(models.Model):
candidat = models.ForeignKey(Candidat, db_column='candidat',
- related_name='candidats')
+ related_name='+')
evaluateur = models.ForeignKey(Evaluateur, db_column='evaluateur',
- related_name='evaluateurs')
+ related_name='+')
note = models.IntegerField()
commentaire = models.TextField()
date = models.DateField(auto_now_add=True)