From 642ef92fec4178981fdc891ddbc029bc7dc60864 Mon Sep 17 00:00:00 2001 From: Lude Ribeiro Date: Thu, 30 Sep 2021 11:00:22 -0300 Subject: [PATCH 1/3] Ordenando contatos SEIT --- sigi/apps/servicos/admin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index 3fb2d4c..75cd0c3 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -233,6 +233,7 @@ class ContatosInline(FuncionariosInline): # A função extra foi usada para quando existir um registro com o campo igual a null não aparecer na frente dos mais novos ) + class CasaAtendidaAdmin(BaseModelAdmin): actions = None list_display = ('codigo_interlegis', 'nome', 'get_servicos',) From 18a3959aa806afd47a971a5737089ca337ee4a65 Mon Sep 17 00:00:00 2001 From: Lude Ribeiro Date: Thu, 28 Oct 2021 11:14:06 -0300 Subject: [PATCH 2/3] Arrumando o erro de portugues no tkt #98 --- sigi/apps/casas/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index d5562de..a5eb2f7 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -69,7 +69,7 @@ class ContatoInterlegisInline(admin.StackedInline): readonly_fields = ('ult_alteracao',) extra = 1 inlines = (TelefonesInline,) - verbose_name_plural = _(u'Contato Interlegis Vigente') + verbose_name_plural = _(u'Contato(s) Interlegis Vigente(s)') def get_queryset(self, request): return (self.model.objects.filter(setor='contato_interlegis') .extra(select={'ult_null': 'ult_alteracao is null'}).order_by('-ult_alteracao') From f65e302a579c0929d6a1f7aef268f0ba8d6bbad6 Mon Sep 17 00:00:00 2001 From: Lude Ribeiro Date: Thu, 4 Nov 2021 15:10:33 -0300 Subject: [PATCH 3/3] Alterando campos do form de Eventos de Date para DateField --- .../migrations/0008_auto_20211104_1253.py | 26 +++++++++++++++++++ sigi/apps/eventos/models.py | 16 +++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 sigi/apps/eventos/migrations/0008_auto_20211104_1253.py diff --git a/sigi/apps/eventos/migrations/0008_auto_20211104_1253.py b/sigi/apps/eventos/migrations/0008_auto_20211104_1253.py new file mode 100644 index 0000000..2231f84 --- /dev/null +++ b/sigi/apps/eventos/migrations/0008_auto_20211104_1253.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('eventos', '0007_auto_20210417_0744'), + ] + + operations = [ + migrations.AlterField( + model_name='evento', + name='data_inicio', + field=models.DateTimeField(null=True, verbose_name='Data/hora do In\xedcio', blank=True), + preserve_default=True, + ), + migrations.AlterField( + model_name='evento', + name='data_termino', + field=models.DateTimeField(null=True, verbose_name='Data/hora do Termino', blank=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/eventos/models.py b/sigi/apps/eventos/models.py index 3fcb85f..964997c 100644 --- a/sigi/apps/eventos/models.py +++ b/sigi/apps/eventos/models.py @@ -1,8 +1,10 @@ # -*- coding: utf-8 -*- - +from datetime import datetime +import random from django.db import models from django.utils.functional import lazy from django.utils.translation import ugettext as _ +from django.contrib.contenttypes import generic from sigi.apps.casas.models import Orgao from sigi.apps.contatos.models import Municipio from sigi.apps.servidores.models import Servidor @@ -35,8 +37,16 @@ class Evento(models.Model): descricao = models.TextField(_(u"Descrição do evento")) virtual = models.BooleanField(_("Virtual"), default=False) solicitante = models.CharField(_(u"Solicitante"), max_length=100) - data_inicio = models.DateField(_(u"Data de início")) - data_termino = models.DateField(_(u"Data de término")) + data_inicio = models.DateTimeField( + _(u"Data/hora do Início"), + null=True, + blank=True + ) + data_termino = models.DateTimeField( + _(u"Data/hora do Termino"), + null=True, + blank=True + ) carga_horaria = models.PositiveIntegerField( _(u"carga horária"), default=0