Browse Source

numero de normas alfa / anexo sessão (#879)

* numeraçao norma alfa

* makemigrations numeraçao norma alga

* Add files via upload

* aceitar numero norma alfa

* aceitar numero norma alfa

* Adiciona anexo sessao

* adiciona upload_anexo sessao_sessaoplenaria

* Add files via upload

* Add files via upload
pull/886/head
Rogério Frá 8 years ago
committed by Edward
parent
commit
ad2bdb4a74
  1. 2
      sapl/materia/tests/test_materia.py
  2. 19
      sapl/norma/migrations/0029_auto_20161215_1652.py
  3. 16
      sapl/norma/migrations/0030_merge.py
  4. 20
      sapl/norma/migrations/0031_auto_20161219_1324.py
  5. 4
      sapl/norma/models.py
  6. 2
      sapl/norma/tests/test_norma.py
  7. 20
      sapl/sessao/migrations/0030_auto_20161215_1652.py
  8. 16
      sapl/sessao/migrations/0031_merge.py
  9. 21
      sapl/sessao/migrations/0032_sessaoplenaria_upload_anexo.py
  10. 9
      sapl/sessao/models.py

2
sapl/materia/tests/test_materia.py

@ -55,7 +55,7 @@ def make_norma():
# Testa se a Norma foi criada
norma = NormaJuridica.objects.first()
assert norma.tipo == tipo
assert norma.numero == 1
assert norma.numero == '1'
assert norma.ano == 2016
return norma

19
sapl/norma/migrations/0029_auto_20161215_1652.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-15 16:52
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('norma', '0028_auto_20161202_1025'),
]
operations = [
migrations.AlterModelOptions(
name='tiponormajuridica',
options={'ordering': ['descricao'], 'verbose_name': 'Tipo de Norma Jurídica', 'verbose_name_plural': 'Tipos de Norma Jurídica'},
),
]

16
sapl/norma/migrations/0030_merge.py

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-19 13:06
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('norma', '0029_auto_20161216_1640'),
('norma', '0029_auto_20161215_1652'),
]
operations = [
]

20
sapl/norma/migrations/0031_auto_20161219_1324.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-19 13:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('norma', '0030_merge'),
]
operations = [
migrations.AlterField(
model_name='normajuridica',
name='numero',
field=models.CharField(max_length=8, verbose_name='Número'),
),
]

4
sapl/norma/models.py

@ -71,7 +71,9 @@ class NormaJuridica(models.Model):
TipoNormaJuridica, verbose_name=_('Tipo da Norma Juridica'))
materia = models.ForeignKey(
MateriaLegislativa, blank=True, null=True, verbose_name=_('Matéria'))
numero = models.PositiveIntegerField(verbose_name=_('Número'))
numero = models.CharField(
max_length=8,
verbose_name=_('Número'))
ano = models.PositiveSmallIntegerField(verbose_name=_('Ano'),
choices=RANGE_ANOS)
esfera_federacao = models.CharField(

2
sapl/norma/tests/test_norma.py

@ -25,7 +25,7 @@ def test_incluir_norma_submit(admin_client):
assert response.status_code == 200
norma = NormaJuridica.objects.first()
assert norma.numero == 1
assert norma.numero == '1'
assert norma.ano == 2016
assert norma.tipo == tipo

20
sapl/sessao/migrations/0030_auto_20161215_1652.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-15 16:52
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sessao', '0029_auto_20161004_1101'),
]
operations = [
migrations.AlterField(
model_name='bancada',
name='nome',
field=models.CharField(max_length=80, verbose_name='Nome da Bancada'),
),
]

16
sapl/sessao/migrations/0031_merge.py

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-19 13:06
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sessao', '0030_auto_20161216_1640'),
('sessao', '0030_auto_20161215_1652'),
]
operations = [
]

21
sapl/sessao/migrations/0032_sessaoplenaria_upload_anexo.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-28 09:53
from __future__ import unicode_literals
from django.db import migrations, models
import sapl.sessao.models
class Migration(migrations.Migration):
dependencies = [
('sessao', '0031_merge'),
]
operations = [
migrations.AddField(
model_name='sessaoplenaria',
name='upload_anexo',
field=models.FileField(blank=True, null=True, upload_to=sapl.sessao.models.anexo_upload_path, verbose_name='Anexo da Sessão'),
),
]

9
sapl/sessao/models.py

@ -84,6 +84,10 @@ def ata_upload_path(instance, filename):
return texto_upload_path(instance, filename, subpath='ata')
# return get_sessao_media_path(instance, 'ata', filename)
def anexo_upload_path(instance, filename):
return texto_upload_path(instance, filename, subpath='anexo')
# return get_sessao_media_path(instance, 'anexo', filename)
class SessaoPlenaria(models.Model):
# TODO trash??? Seems to have been a FK in the past. Would be:
@ -123,6 +127,11 @@ class SessaoPlenaria(models.Model):
upload_to=ata_upload_path,
verbose_name=_('Ata da Sessão'),
validators=[restringe_tipos_de_arquivo_txt])
upload_anexo = models.FileField(
blank=True,
null=True,
upload_to=anexo_upload_path,
verbose_name=_('Anexo da Sessão'))
iniciada = models.NullBooleanField(blank=True,
choices=YES_NO_CHOICES,
verbose_name=_('Sessão iniciada?'))

Loading…
Cancel
Save