Browse Source

Corrigindo falha na geração de relatórios

0.3
Camilo Carlos (Estagiario) 15 years ago
parent
commit
8e35dd91da
  1. 4
      sigi/apps/convenios/views.py

4
sigi/apps/convenios/views.py

@ -9,12 +9,14 @@ def report(request, id=None):
qs = qs.filter(pk=id) qs = qs.filter(pk=id)
elif request.GET: #Se tiver algum parametro de pesquisa elif request.GET: #Se tiver algum parametro de pesquisa
kwargs = {} kwargs = {}
ids = 0
for k, v in request.GET.iteritems(): for k, v in request.GET.iteritems():
kwargs[str(k)] = v kwargs[str(k)] = v
if(str(k)=='ids'): if(str(k)=='ids'):
ids = 1
break break
qs = qs.filter(**kwargs) qs = qs.filter(**kwargs)
if kwargs['ids']: if ids:
query = 'id IN ('+ kwargs['ids'].__str__()+')' query = 'id IN ('+ kwargs['ids'].__str__()+')'
qs = Convenio.objects.extra(where=[query]) qs = Convenio.objects.extra(where=[query])
if not qs: if not qs:

Loading…
Cancel
Save