Browse Source

Fix #1099

pull/1192/head
Eduardo Calil 8 years ago
parent
commit
50b95c0d8c
  1. 23
      sapl/sessao/views.py

23
sapl/sessao/views.py

@ -164,6 +164,16 @@ class MateriaOrdemDiaCrud(MasterDetailCrud):
class ListView(MasterDetailCrud.ListView):
ordering = ['numero_ordem', 'materia', 'resultado']
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
for i in range(len(context['rows'])):
materia = context['object_list'][i].materia
url_materia = reverse('sapl.materia:materialegislativa_detail',
kwargs={'pk': materia.id})
context['rows'][i][1] = (context['rows'][i][1][0], url_materia)
return context
def get_rows(self, object_list):
for obj in object_list:
exist_resultado = obj.registrovotacao_set.filter(
@ -280,11 +290,20 @@ class ExpedienteMateriaCrud(MasterDetailCrud):
class ListView(MasterDetailCrud.ListView):
ordering = ['numero_ordem', 'materia', 'resultado']
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
for i in range(len(context['rows'])):
materia = context['object_list'][i].materia
url_materia = reverse('sapl.materia:materialegislativa_detail',
kwargs={'pk': materia.id})
context['rows'][i][1] = (context['rows'][i][1][0], url_materia)
return context
def get_rows(self, object_list):
for obj in object_list:
exist_resultado = obj.registrovotacao_set.filter(
materia=obj.materia
).exists()
materia=obj.materia).exists()
if not exist_resultado:
if obj.votacao_aberta:
url = ''

Loading…
Cancel
Save