Browse Source

HOT-FIX: solct lst GITEC p ampl campos model Orgao

pull/3372/head
Leandro Roberto 4 years ago
parent
commit
7390779019
  1. 23
      sapl/materia/migrations/0079_auto_20210311_1711.py
  2. 26
      sapl/materia/models.py

23
sapl/materia/migrations/0079_auto_20210311_1711.py

@ -0,0 +1,23 @@
# Generated by Django 2.2.13 on 2021-03-11 20:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('materia', '0078_historicoproposicao'),
]
operations = [
migrations.AlterField(
model_name='orgao',
name='nome',
field=models.CharField(max_length=256, verbose_name='Nome'),
),
migrations.AlterField(
model_name='orgao',
name='sigla',
field=models.CharField(max_length=15, verbose_name='Sigla'),
),
]

26
sapl/materia/models.py

@ -548,10 +548,13 @@ class TipoDocumento(models.Model):
@reversion.register() @reversion.register()
class DocumentoAcessorio(models.Model): class DocumentoAcessorio(models.Model):
materia = models.ForeignKey(MateriaLegislativa, on_delete=models.CASCADE) materia = models.ForeignKey(MateriaLegislativa, on_delete=models.CASCADE)
tipo = models.ForeignKey(TipoDocumento, on_delete=models.PROTECT, verbose_name=_('Tipo')) tipo = models.ForeignKey(
TipoDocumento, on_delete=models.PROTECT, verbose_name=_('Tipo'))
nome = models.CharField(max_length=50, verbose_name=_('Nome')) nome = models.CharField(max_length=50, verbose_name=_('Nome'))
data = models.DateField(blank=True, null=True, default=None, verbose_name=_('Data')) data = models.DateField(blank=True, null=True,
autor = models.CharField(max_length=200, blank=True, verbose_name=_('Autor')) default=None, verbose_name=_('Data'))
autor = models.CharField(
max_length=200, blank=True, verbose_name=_('Autor'))
ementa = models.TextField(blank=True, verbose_name=_('Ementa')) ementa = models.TextField(blank=True, verbose_name=_('Ementa'))
indexacao = models.TextField(blank=True) indexacao = models.TextField(blank=True)
arquivo = models.FileField( arquivo = models.FileField(
@ -563,7 +566,8 @@ class DocumentoAcessorio(models.Model):
storage=OverwriteStorage(), storage=OverwriteStorage(),
validators=[restringe_tipos_de_arquivo_txt]) validators=[restringe_tipos_de_arquivo_txt])
proposicao = GenericRelation('Proposicao', related_query_name='proposicao') proposicao = GenericRelation('Proposicao', related_query_name='proposicao')
data_ultima_atualizacao = models.DateTimeField(blank=True, null=True, auto_now=True, verbose_name=_('Data')) data_ultima_atualizacao = models.DateTimeField(
blank=True, null=True, auto_now=True, verbose_name=_('Data'))
class Meta: class Meta:
verbose_name = _('Documento Acessório') verbose_name = _('Documento Acessório')
@ -661,8 +665,8 @@ class Numeracao(models.Model):
@reversion.register() @reversion.register()
class Orgao(models.Model): class Orgao(models.Model):
nome = models.CharField(max_length=60, verbose_name=_('Nome')) nome = models.CharField(max_length=256, verbose_name=_('Nome'))
sigla = models.CharField(max_length=10, verbose_name=_('Sigla')) sigla = models.CharField(max_length=15, verbose_name=_('Sigla'))
unidade_deliberativa = models.BooleanField( unidade_deliberativa = models.BooleanField(
choices=YES_NO_CHOICES, choices=YES_NO_CHOICES,
verbose_name=(_('Unidade Deliberativa')), verbose_name=(_('Unidade Deliberativa')),
@ -1123,7 +1127,8 @@ class UnidadeTramitacao(models.Model):
class Meta: class Meta:
verbose_name = _('Unidade de Tramitação') verbose_name = _('Unidade de Tramitação')
verbose_name_plural = _('Unidades de Tramitação') verbose_name_plural = _('Unidades de Tramitação')
ordering = ('orgao__nome', 'comissao__sigla', 'parlamentar__nome_parlamentar') ordering = ('orgao__nome', 'comissao__sigla',
'parlamentar__nome_parlamentar')
def __str__(self): def __str__(self):
if self.orgao and self.comissao and self.parlamentar: if self.orgao and self.comissao and self.parlamentar:
@ -1232,7 +1237,8 @@ class Tramitacao(models.Model):
class MateriaEmTramitacao(models.Model): class MateriaEmTramitacao(models.Model):
materia = models.ForeignKey(MateriaLegislativa, on_delete=models.DO_NOTHING) materia = models.ForeignKey(
MateriaLegislativa, on_delete=models.DO_NOTHING)
tramitacao = models.ForeignKey(Tramitacao, on_delete=models.DO_NOTHING) tramitacao = models.ForeignKey(Tramitacao, on_delete=models.DO_NOTHING)
class Meta: class Meta:
@ -1250,7 +1256,7 @@ class ConfigEtiquetaMateriaLegislativa(models.Model):
class Meta: class Meta:
ordering = ('id',) ordering = ('id',)
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
self.id = 1 self.id = 1
return super().save(*args, **kwargs) return super().save(*args, **kwargs)

Loading…
Cancel
Save