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