Changeset a495b78 in sicp
- Timestamp:
- Jun 17, 2015, 10:31:22 AM (9 years ago)
- Branches:
- master
- Children:
- 0000e70
- Parents:
- 4b60864
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/simulacion/sigesic/views.py
r73d807c ra495b78 111 111 arc = arcs.findall('arc') 112 112 113 114 # Instrucción que permite obtener los niveles representados en la cadena aguas arriba y aguas abajo 115 for a in arc: 116 narriba = [] 117 nabajo = [] 118 for n in node: 119 # Condición que evalúa si contiene niveles aguas arriba 120 if a.attrib['tgt'] == '0' and n.attrib['position'] == a.attrib['src'] and n.attrib['level'] not in narriba: 121 #Niveles Aguas Arriba 122 narriba.append(n.attrib['level']) 123 124 # Condición que evalúa si contiene niveles aguas abajo 125 elif a.attrib['src'] == '0' and n.attrib['position'] == a.attrib['tgt'] and n.attrib['level'] not in nabajo: 126 #Niveles Aguas Abajo 127 nabajo.append(n.attrib['level']) 128 129 attrs = root.find('attributes') 130 # Variable que contiene el año de consulta de la cadena productiva 131 anho = attrs.find('year').items()[0][1] 132 133 113 134 pr_id = request.GET.get('ciiu', None) 114 135 … … 116 137 pr = Producto.objects.using('sigesic').get(pk=pr_id) 117 138 118 return render_to_response("cadena_productiva.html", {'node': node, 'arc': arc, 'pr': pr}, 139 return render_to_response("cadena_productiva.html", {'node': node, 'arc': arc, 'pr': pr, 140 'narriba':narriba, 'nabajo': nabajo, 'anho': anho}, 119 141 context_instance=RequestContext(request))
Note: See TracChangeset
for help on using the changeset viewer.