Browse Source

Adicionando relatorio de Casas sem convenio

diagnosticos
Starlone (Estagiario) 15 years ago
parent
commit
7173b9b307
  1. 2
      sigi/apps/casas/reports.py
  2. 1
      sigi/apps/casas/templates/casas/change_list.html
  3. 8
      sigi/apps/casas/views.py
  4. 2
      sigi/urls.py

2
sigi/apps/casas/reports.py

@ -43,7 +43,7 @@ class CasasLegislativasLabels(Report):
ManyElements(
ObjectValue,
count=5,
attribute_name=('get_presidente_nome','nome','logradouro','municipio','cep'),
attribute_name=('parlamentar','nome','logradouro','municipio','cep'),
start_top=1.5*cm, height=0.5*cm, left=1*cm, width=9.4*cm,
),
]

1
sigi/apps/casas/templates/casas/change_list.html

@ -5,6 +5,7 @@
{% if has_add_permission %}
<ul class="object-tools">
<li><a href="reports/{{query_str}}">Relatório</a> </li>
<li><a href="casas_sem_convenio_report">Casas sem convênio</a> </li>
<li><a href="labels/{{ query_str }}">Gerar etiquetas</a></li>
<li>
<a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">

8
sigi/apps/casas/views.py

@ -40,3 +40,11 @@ def report(request, id=None):
report = CasasLegislativasReport(queryset=qs)
report.generate_by(PDFGenerator, filename=response)
return response
def casas_sem_convenio_report(request):
qs = CasaLegislativa.objects.filter(convenio=None).order_by('municipio__uf','nome')
response = HttpResponse(mimetype='application/pdf')
report = CasasLegislativasReport(queryset=qs)
report.generate_by(PDFGenerator, filename=response)
return response

2
sigi/urls.py

@ -16,6 +16,8 @@ urlpatterns = patterns(
# reports
(r'^casas/casalegislativa/reports/',
'sigi.apps.casas.views.report'),
(r'^casas/casalegislativa/casas_sem_convenio_report/',
'sigi.apps.casas.views.casas_sem_convenio_report'),
(r'^convenios/convenio/reports/',
'sigi.apps.convenios.views.report'),
(r'^convenios/convenio/reportsRegiao/',

Loading…
Cancel
Save