From 8e35dd91da08df8b45d1d2c720c787ebe739852f Mon Sep 17 00:00:00 2001 From: "Camilo Carlos (Estagiario)" Date: Mon, 17 May 2010 20:11:20 +0000 Subject: [PATCH] =?UTF-8?q?Corrigindo=20falha=20na=20gera=C3=A7=C3=A3o=20d?= =?UTF-8?q?e=20relat=C3=B3rios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/convenios/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sigi/apps/convenios/views.py b/sigi/apps/convenios/views.py index 50d88b6..352315b 100644 --- a/sigi/apps/convenios/views.py +++ b/sigi/apps/convenios/views.py @@ -9,12 +9,14 @@ def report(request, id=None): qs = qs.filter(pk=id) elif request.GET: #Se tiver algum parametro de pesquisa kwargs = {} + ids = 0 for k, v in request.GET.iteritems(): kwargs[str(k)] = v if(str(k)=='ids'): + ids = 1 break qs = qs.filter(**kwargs) - if kwargs['ids']: + if ids: query = 'id IN ('+ kwargs['ids'].__str__()+')' qs = Convenio.objects.extra(where=[query]) if not qs: