From 3a0f10cc0d1dd9dcab5ffed4f9c519958ab835ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 8 Dec 2022 15:49:36 -0300 Subject: [PATCH] =?UTF-8?q?Ajusta=20exporta=C3=A7=C3=A3o=20de=20=C3=B3rg?= =?UTF-8?q?=C3=A3os?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/casas/admin.py | 6 ++++++ .../casas/migrations/0027_alter_orgao_email.py | 18 ++++++++++++++++++ sigi/apps/casas/models.py | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 sigi/apps/casas/migrations/0027_alter_orgao_email.py diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 24361ff..7dcfbad 100644 --- a/sigi/apps/casas/admin.py +++ b/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.servidores.models import Servidor from sigi.apps.utils import queryset_ascii +from sigi.apps.utils.filters import EmptyFilter from sigi.apps.utils.mixins import ( ReturnMixin, CartExportReportMixin, @@ -34,6 +35,7 @@ class OrgaoExportResourse(LabeledResourse): telefone = Field(column_name="telefone") # servicos_seit = Field(column_name='servicos_seit') contato = Field(column_name="contato") + nome = Field(column_name="nome") class Meta: model = Orgao @@ -56,6 +58,9 @@ class OrgaoExportResourse(LabeledResourse): ) export_order = fields + def dehydrate_nome(self, orgao): + return orgao.nome[:50] + def dehydrate_presidente(self, orgao): return orgao.presidente @@ -319,6 +324,7 @@ class OrgaoAdmin(CartExportReportMixin, admin.ModelAdmin): ExcluirConvenioFilter, ServicoFilter, "inclusao_digital", + ("email", EmptyFilter), ) ordering = ("municipio__uf__nome", "nome") queryset = queryset_ascii diff --git a/sigi/apps/casas/migrations/0027_alter_orgao_email.py b/sigi/apps/casas/migrations/0027_alter_orgao_email.py new file mode 100644 index 0000000..cc1546f --- /dev/null +++ b/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"), + ), + ] diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index 258a66c..dfb0e0f 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -74,7 +74,7 @@ class Orgao(models.Model): verbose_name=_("município"), ) 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( _("página web"), help_text=_("Exemplo: http://www.camarapains.mg.gov.br."),