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."),