Browse Source

Ajusta exportação de órgãos

pull/160/head
Sesostris Vieira 2 years ago
parent
commit
3a0f10cc0d
  1. 6
      sigi/apps/casas/admin.py
  2. 18
      sigi/apps/casas/migrations/0027_alter_orgao_email.py
  3. 2
      sigi/apps/casas/models.py

6
sigi/apps/casas/admin.py

@ -22,6 +22,7 @@ from sigi.apps.servicos.models import Servico
from sigi.apps.servicos.filters import ServicoAtivoFilter from sigi.apps.servicos.filters import ServicoAtivoFilter
from sigi.apps.servidores.models import Servidor from sigi.apps.servidores.models import Servidor
from sigi.apps.utils import queryset_ascii from sigi.apps.utils import queryset_ascii
from sigi.apps.utils.filters import EmptyFilter
from sigi.apps.utils.mixins import ( from sigi.apps.utils.mixins import (
ReturnMixin, ReturnMixin,
CartExportReportMixin, CartExportReportMixin,
@ -34,6 +35,7 @@ class OrgaoExportResourse(LabeledResourse):
telefone = Field(column_name="telefone") telefone = Field(column_name="telefone")
# servicos_seit = Field(column_name='servicos_seit') # servicos_seit = Field(column_name='servicos_seit')
contato = Field(column_name="contato") contato = Field(column_name="contato")
nome = Field(column_name="nome")
class Meta: class Meta:
model = Orgao model = Orgao
@ -56,6 +58,9 @@ class OrgaoExportResourse(LabeledResourse):
) )
export_order = fields export_order = fields
def dehydrate_nome(self, orgao):
return orgao.nome[:50]
def dehydrate_presidente(self, orgao): def dehydrate_presidente(self, orgao):
return orgao.presidente return orgao.presidente
@ -319,6 +324,7 @@ class OrgaoAdmin(CartExportReportMixin, admin.ModelAdmin):
ExcluirConvenioFilter, ExcluirConvenioFilter,
ServicoFilter, ServicoFilter,
"inclusao_digital", "inclusao_digital",
("email", EmptyFilter),
) )
ordering = ("municipio__uf__nome", "nome") ordering = ("municipio__uf__nome", "nome")
queryset = queryset_ascii queryset = queryset_ascii

18
sigi/apps/casas/migrations/0027_alter_orgao_email.py

@ -0,0 +1,18 @@
# Generated by Django 4.1.4 on 2022-12-08 18:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("casas", "0026_carga_telefone_geral"),
]
operations = [
migrations.AlterField(
model_name="orgao",
name="email",
field=models.EmailField(blank=True, max_length=128, verbose_name="email"),
),
]

2
sigi/apps/casas/models.py

@ -74,7 +74,7 @@ class Orgao(models.Model):
verbose_name=_("município"), verbose_name=_("município"),
) )
cep = models.CharField(_("CEP"), max_length=32) cep = models.CharField(_("CEP"), max_length=32)
email = models.EmailField(_("e-mail"), max_length=128, blank=True) email = models.EmailField(_("email"), max_length=128, blank=True)
pagina_web = models.URLField( pagina_web = models.URLField(
_("página web"), _("página web"),
help_text=_("Exemplo: <em>http://www.camarapains.mg.gov.br</em>."), help_text=_("Exemplo: <em>http://www.camarapains.mg.gov.br</em>."),

Loading…
Cancel
Save