|
|
@ -70,146 +70,35 @@ class CasasLegislativasLabels(Report): |
|
|
|
|
|
|
|
default_style = {'fontName': 'Helvetica', 'fontSize': 11} |
|
|
|
|
|
|
|
elements = [ |
|
|
|
Label( |
|
|
|
text='A Sua Excelência o(a) Senhor(a)', |
|
|
|
top=1*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='presidente', |
|
|
|
top=1.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='nome', |
|
|
|
top=2*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
"Presidente da " + instance.nome |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='logradouro', |
|
|
|
top=2.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
(instance.logradouro +" - "+ instance.bairro) |
|
|
|
if len(instance.bairro) != 0 |
|
|
|
else instance.logradouro |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='municipio', |
|
|
|
top=3*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='cep', |
|
|
|
top=3.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
] |
|
|
|
|
|
|
|
class CasasLabelsNomeMaior(CasasLegislativasLabels): |
|
|
|
class band_detail(CasasLegislativasLabels.band_detail): |
|
|
|
elements = [ |
|
|
|
Label( |
|
|
|
text='A Sua Excelência o(a) Senhor(a)', |
|
|
|
top=1*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='presidente', |
|
|
|
attribute_name='tipo', |
|
|
|
top=1.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='nome', |
|
|
|
top=2*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
"Presidente da " + instance.nome |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='logradouro', |
|
|
|
top=3*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
instance.logradouro +" - "+ instance.bairro |
|
|
|
if len(instance.bairro) != 0 |
|
|
|
else instance.logradouro |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='municipio', |
|
|
|
top=3.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='cep', |
|
|
|
top=4*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
] |
|
|
|
|
|
|
|
class CasasLabelsEnderecoMaior(CasasLegislativasLabels): |
|
|
|
class band_detail(CasasLegislativasLabels.band_detail): |
|
|
|
elements = [ |
|
|
|
Label( |
|
|
|
text='A Sua Excelência o(a) Senhor(a)', |
|
|
|
top=1*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='presidente', |
|
|
|
top=1.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
"Presidente da " + instance.tipo.nome + " de " |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='nome', |
|
|
|
top=2*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
"Presidente da " + instance.nome |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='logradouro', |
|
|
|
top=2.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
instance.logradouro +" - "+ instance.bairro |
|
|
|
if len(instance.bairro) != 0 |
|
|
|
else instance.logradouro |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='municipio', |
|
|
|
top=3.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='cep', |
|
|
|
top=4*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
] |
|
|
|
instance.municipio.uf.nome |
|
|
|
if instance.tipo.nome == u'Assembléia Legislativa' |
|
|
|
else instance.municipio.nome |
|
|
|
|
|
|
|
class CasasLabelsNomeMaiorEnderecoMaior(CasasLegislativasLabels): |
|
|
|
class band_detail(CasasLegislativasLabels.band_detail): |
|
|
|
elements = [ |
|
|
|
Label( |
|
|
|
text='A Sua Excelência o(a) Senhor(a)', |
|
|
|
top=1*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='presidente', |
|
|
|
top=1.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
ManyElements( |
|
|
|
ObjectValue, |
|
|
|
count=4, |
|
|
|
attribute_name=('logradouro','bairro','municipio','cep'), |
|
|
|
start_top=2.5*cm, height=0.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='nome', |
|
|
|
top=2*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
"Presidente da " + instance.nome |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='logradouro', |
|
|
|
top=3*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
instance.logradouro +" - "+ instance.bairro |
|
|
|
if len(instance.bairro) != 0 |
|
|
|
else instance.logradouro |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='municipio', |
|
|
|
top=4*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='cep', |
|
|
|
top=4.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
class CasasLegislativasReport(ReportDefault): |
|
|
|
title = u'Relatório de Casas Legislativas' |
|
|
|