47e708df7e3f27a9dda3d43272b1ea21edf70385
1 # -*- encoding: utf-8 -*-
3 from django
.core
.management
.base
import BaseCommand
, CommandError
4 from project
.rh
.models
import Poste
, Employe
9 Mettre a jour le booleen de poste pour savoir si le poste
12 for p
in Poste
.objects
.all():
14 employes
= p
.occupe_par()
30 for e
in Employe
.objects
.all():
33 for d
in e
.rh_dossiers
.all():
34 if d
.date_fin
is None:
41 class Command(BaseCommand
):
43 def handle(self
, *args
, **options
):
45 if args
[0] == "vacant":
47 self
.stdout
.write("Flag vacant mis à jour\n")
49 if args
[0] == "nb_postes":
51 self
.stdout
.write("Flag nb_postes mis à jour\n")