Browse Source

Merge pull request #102 from interlegis/new_sigi

New sigi
pull/108/head
Lude Ribeiro 3 years ago
committed by GitHub
parent
commit
53e2d3d1ff
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      sigi/apps/casas/admin.py
  2. 26
      sigi/apps/eventos/migrations/0008_auto_20211104_1253.py
  3. 16
      sigi/apps/eventos/models.py
  4. 1
      sigi/apps/servicos/admin.py

2
sigi/apps/casas/admin.py

@ -69,7 +69,7 @@ class ContatoInterlegisInline(admin.StackedInline):
readonly_fields = ('ult_alteracao',) readonly_fields = ('ult_alteracao',)
extra = 1 extra = 1
inlines = (TelefonesInline,) inlines = (TelefonesInline,)
verbose_name_plural = _(u'Contato Interlegis Vigente') verbose_name_plural = _(u'Contato(s) Interlegis Vigente(s)')
def get_queryset(self, request): def get_queryset(self, request):
return (self.model.objects.filter(setor='contato_interlegis') return (self.model.objects.filter(setor='contato_interlegis')
.extra(select={'ult_null': 'ult_alteracao is null'}).order_by('-ult_alteracao') .extra(select={'ult_null': 'ult_alteracao is null'}).order_by('-ult_alteracao')

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

1
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 # 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): class CasaAtendidaAdmin(BaseModelAdmin):
actions = None actions = None
list_display = ('codigo_interlegis', 'nome', 'get_servicos',) list_display = ('codigo_interlegis', 'nome', 'get_servicos',)

Loading…
Cancel
Save