From baf2b430c8922f19d711ac21623bc7405054753f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 28 May 2013 16:30:47 -0300 Subject: [PATCH] =?UTF-8?q?Pequenas=20corre=C3=A7=C3=B5es=20no=20dashboard?= =?UTF-8?q?=20de=20metas=20e=20gatilhos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/metas/views.py | 6 ------ sigi/templates/metas/dashboard.html | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/sigi/apps/metas/views.py b/sigi/apps/metas/views.py index 4336412..b6601bd 100644 --- a/sigi/apps/metas/views.py +++ b/sigi/apps/metas/views.py @@ -41,18 +41,12 @@ def dashboard(request): for p in projetos: matriz[p.id] = (p.sigla, dados.copy()) - g_desembolsos = {'labels': [], 'legends': [p.sigla for p in projetos], 'data': [], 'max': 0, 'coisa': [] } for date in meses: mes_ano = '%s/%s' % (date.month, date.year) - g_desembolsos['labels'].append(mes_ano) - data = {p.id: 0 for p in projetos} for d in Desembolso.objects.filter(data__year=date.year, data__month=date.month).values('projeto').annotate(total_dolar=Sum('valor_dolar')): - data[d['projeto']] = int(d['total_dolar']) if int(d['total_dolar']) > desembolsos_max: desembolsos_max = int(d['total_dolar']) - p = Projeto.objects.get(pk=d['projeto']) matriz[d['projeto']][1][mes_ano] += int(d['total_dolar']) - g_desembolsos['data'].append(data.values()) meses = ["%s/%s" % (m.month, m.year) for m in reversed(meses)] extra_context = {'desembolsos': matriz, 'desembolsos_max': desembolsos_max, 'meses': meses, 'colors': ','.join(colors[:len(matriz)])} diff --git a/sigi/templates/metas/dashboard.html b/sigi/templates/metas/dashboard.html index 6c0b909..f4f67ec 100644 --- a/sigi/templates/metas/dashboard.html +++ b/sigi/templates/metas/dashboard.html @@ -10,11 +10,13 @@ {% block content_title %}

Triggers e indicadores de progresso

+{% comment %}
-

Esta é a toolbar da changelist

+

+{% endcomment %} {% endblock %} {% block content %}