Browse Source

Alterando campos do form de Eventos de Date para DateField

pull/102/head
Lude Ribeiro 3 years ago
parent
commit
f65e302a57
  1. 26
      sigi/apps/eventos/migrations/0008_auto_20211104_1253.py
  2. 16
      sigi/apps/eventos/models.py

26
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,
),
]

16
sigi/apps/eventos/models.py

@ -1,8 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from datetime import datetime
import random
from django.db import models from django.db import models
from django.utils.functional import lazy from django.utils.functional import lazy
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.contrib.contenttypes import generic
from sigi.apps.casas.models import Orgao from sigi.apps.casas.models import Orgao
from sigi.apps.contatos.models import Municipio from sigi.apps.contatos.models import Municipio
from sigi.apps.servidores.models import Servidor from sigi.apps.servidores.models import Servidor
@ -35,8 +37,16 @@ class Evento(models.Model):
descricao = models.TextField(_(u"Descrição do evento")) descricao = models.TextField(_(u"Descrição do evento"))
virtual = models.BooleanField(_("Virtual"), default=False) virtual = models.BooleanField(_("Virtual"), default=False)
solicitante = models.CharField(_(u"Solicitante"), max_length=100) solicitante = models.CharField(_(u"Solicitante"), max_length=100)
data_inicio = models.DateField(_(u"Data de início")) data_inicio = models.DateTimeField(
data_termino = models.DateField(_(u"Data de término")) _(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( carga_horaria = models.PositiveIntegerField(
_(u"carga horária"), _(u"carga horária"),
default=0 default=0

Loading…
Cancel
Save