Skip to content

Commit

Permalink
show only sorted iniciativas by codigo
Browse files Browse the repository at this point in the history
  • Loading branch information
aniversarioperu committed Oct 16, 2014
1 parent 9672039 commit 74b3f24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions proyectos_de_ley/seguimientos/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def prepare_json_for_d3(item):
j = 1
for i in item.iniciativas_agrupadas:
queryset = Proyecto.objects.get(codigo=i)
node = {"name": i, "url": "/p/" + queryset.short_url}
node = {"codigo": i, "url": "/p/" + queryset.short_url}
append(node)
j += 1

# sort nodes by value (codigo)
sorted_nodes_by_value = sorted(nodes, key=lambda k: k['name'])
sorted_nodes_by_value = sorted(nodes, key=lambda k: k['codigo'])
data_json = {"nodes": sorted_nodes_by_value}
return data_json

Expand Down

0 comments on commit 74b3f24

Please sign in to comment.