Browse Source

Conserta bug na geração de relatório com UF

pull/258/head
Edward Ribeiro 9 years ago
parent
commit
9d2bc13420
  1. 6
      base/urls.py
  2. 3
      relatorios/views.py
  3. 4
      sapl/utils.py

6
base/urls.py

@ -1,6 +1,8 @@
from django.conf.urls import url
from django.views.generic.base import TemplateView
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from .views import CasaLegislativaTableAuxView, HelpView
urlpatterns = [
@ -11,3 +13,7 @@ urlpatterns = [
url(r'^casa-legislativa$',
CasaLegislativaTableAuxView.as_view(), name='casa_legislativa'),
]
# Fix a static asset finding error on Django 1.9 + gunicorn:
# http://stackoverflow.com/questions/35510373/
urlpatterns += staticfiles_urlpatterns()

3
relatorios/views.py

@ -42,7 +42,8 @@ def get_cabecalho(casa):
cabecalho = {}
cabecalho["nom_casa"] = casa.nome
# FIXME i18n
cabecalho["nom_estado"] = "Estado de " + UF[casa.uf.upper()]
uf_dic = dict(UF)
cabecalho["nom_estado"] = "Estado de " + uf_dic[casa.uf.upper()]
return cabecalho

4
sapl/utils.py

@ -87,7 +87,7 @@ def listify(function):
return list(function(*args, **kwargs))
return f
UF = (
UF = [
('AC', 'Acre'),
('AL', 'Alagoas'),
('AP', 'Amapá'),
@ -116,6 +116,6 @@ UF = (
('SP', 'São Paulo'),
('TO', 'Tocantins'),
('EX', 'Exterior'),
)
]
RANGE_ANOS = [(year, year) for year in range(date.today().year, 1889, -1)]

Loading…
Cancel
Save