{% block contentrapport %}
<ul>
- {% for d in data %}
- <li>{{ d.region.nom }}
- <ul>
- {% for i in d.implantations %}
- <li> {{ i.implantation.nom }} ({{ i.num_postes }})
- <ul>
- {% for p in i.postes %}
- <li>{{ p.nom }} [{{ p.id }}]</li>
- {% endfor %}
- </ul>
- </li>
- {% endfor %}
- </ul>
- </li>
+ {% for f in data %}
+ <li>
+ {{ f.famille.nom }} ({{ f.nb_types }})
+ <ul>
+ {% for t in f.types %}
+ <li>
+ {{ t.type.nom }} ({{ t.num_postes }})
+ <ul>
+ {% for p in t.postes %}
+ <li>{{ p.nom }} [{{ p.id }}]</li>
+ {% endfor %}
+ </ul>
+ </li>
+ {% endfor %}
+ </ul>
+ </li>
{% endfor %}
</ul>
{% endblock %}
def rapports_postes_modelisation(request):
c = {}
data = []
- for r in ref.Region.objects.all():
- implantations = []
- for i in ref.modelisation.objects.filter(region=r):
- implantations.append({
- 'implantation': i,
- 'postes': rh.Poste.objects.filter(implantation=i),
- 'num_postes': rh.Poste.objects.filter(implantation=i).count(),
+
+ for f in rh.FamilleEmploi.objects.all():
+ types = rh.TypePoste.objects.filter(famille_emploi=f)
+ data_types = []
+ for t in types.all():
+ postes = rh.Poste.objects.filter(type_poste=t)
+ data_types.append({
+ 'num_postes': postes.count(),
+ 'postes': postes.all(),
+ 'type': f,
})
+
data.append({
- 'region': r,
- 'implantations': implantations
+ 'famille': f,
+ 'nb_types': types.count(),
+ 'types' : data_types
})
c['data'] = data