projets
/
auf_rh_dae.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0297804
)
Rapport hierarchique avec networkx
author
Jean-Philippe Caissy
<jpcaissy@piji.ca>
Fri, 24 Feb 2012 15:18:34 +0000
(09:18 -0600)
committer
Jean-Philippe Caissy
<jpcaissy@piji.ca>
Fri, 24 Feb 2012 15:18:34 +0000
(09:18 -0600)
project/rh/views.py
patch
|
blob
|
blame
|
history
diff --git
a/project/rh/views.py
b/project/rh/views.py
index
aa969b3
..
2477e2b
100644
(file)
--- a/
project/rh/views.py
+++ b/
project/rh/views.py
@@
-74,14
+74,14
@@
def employe(request, id):
def rapports_postes_hierarchie(request):
c = {}
- graph = nx.Graph()
+ graph = nx.DiGraph()
postes = rh.Poste.objects.all()
postes_id = dict((p.id, p) for p in postes)
- graph.add_node(p.id for p in postes)
+ graph.add_node(p for p in postes)
for p in postes:
if p.responsable_id != p.id:
- graph.add_edge(postes_id[p.responsable_id].id, p.id)
+ graph.add_edge(postes_id[p.responsable_id], p)
c['postes'] = nx.to_dict_of_lists(graph)