From 54bdb0b2ce5680f150243ddbf3b022a453957324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Mon, 19 Dec 2016 13:44:04 -0200 Subject: [PATCH 1/9] =?UTF-8?q?numera=C3=A7ao=20norma=20alfa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/norma/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sapl/norma/models.py b/sapl/norma/models.py index 4d9780038..6abf975c4 100644 --- a/sapl/norma/models.py +++ b/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( From 9e31efac7ba68466243d218b4780197fa41f0681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Mon, 19 Dec 2016 13:46:28 -0200 Subject: [PATCH 2/9] =?UTF-8?q?makemigrations=20numera=C3=A7ao=20norma=20a?= =?UTF-8?q?lga?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/norma/migrations/0030_merge.py | 16 +++++++++++++++ .../migrations/0031_auto_20161219_1324.py | 20 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 sapl/norma/migrations/0030_merge.py create mode 100644 sapl/norma/migrations/0031_auto_20161219_1324.py diff --git a/sapl/norma/migrations/0030_merge.py b/sapl/norma/migrations/0030_merge.py new file mode 100644 index 000000000..beb05625c --- /dev/null +++ b/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 = [ + ] diff --git a/sapl/norma/migrations/0031_auto_20161219_1324.py b/sapl/norma/migrations/0031_auto_20161219_1324.py new file mode 100644 index 000000000..27d77c035 --- /dev/null +++ b/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'), + ), + ] From 862fad5866e5cd722ac7c7ee103653a55fa67926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Mon, 19 Dec 2016 14:11:59 -0200 Subject: [PATCH 3/9] Add files via upload --- .../migrations/0029_auto_20161215_1652.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 sapl/norma/migrations/0029_auto_20161215_1652.py diff --git a/sapl/norma/migrations/0029_auto_20161215_1652.py b/sapl/norma/migrations/0029_auto_20161215_1652.py new file mode 100644 index 000000000..9ef00a353 --- /dev/null +++ b/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'}, + ), + ] From 2265cc23ebc44ef4fc8b7818e4586fa652ab1c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Mon, 19 Dec 2016 15:44:51 -0200 Subject: [PATCH 4/9] aceitar numero norma alfa --- sapl/materia/tests/test_materia.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/materia/tests/test_materia.py b/sapl/materia/tests/test_materia.py index 4f88a8b79..20f3a12fa 100644 --- a/sapl/materia/tests/test_materia.py +++ b/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 From 82bc917f84526331c8a7fd067dbf6e5289b4d30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Mon, 19 Dec 2016 15:44:54 -0200 Subject: [PATCH 5/9] aceitar numero norma alfa --- sapl/norma/tests/test_norma.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/norma/tests/test_norma.py b/sapl/norma/tests/test_norma.py index 65c0f28b1..6f12baa17 100644 --- a/sapl/norma/tests/test_norma.py +++ b/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 From 2e96b776d1dc295050eb9a4d91d829c99ee49e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Wed, 28 Dec 2016 10:11:59 -0200 Subject: [PATCH 6/9] Adiciona anexo sessao --- sapl/sessao/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sapl/sessao/models.py b/sapl/sessao/models.py index 2ad10beed..b76d8f325 100644 --- a/sapl/sessao/models.py +++ b/sapl/sessao/models.py @@ -85,6 +85,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: @@ -124,6 +128,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?')) From 81a617f2ad77f6fa46e9ef57e817ab53f57d5dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Wed, 28 Dec 2016 10:13:16 -0200 Subject: [PATCH 7/9] adiciona upload_anexo sessao_sessaoplenaria --- .../0032_sessaoplenaria_upload_anexo.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 sapl/sessao/migrations/0032_sessaoplenaria_upload_anexo.py diff --git a/sapl/sessao/migrations/0032_sessaoplenaria_upload_anexo.py b/sapl/sessao/migrations/0032_sessaoplenaria_upload_anexo.py new file mode 100644 index 000000000..9a846f587 --- /dev/null +++ b/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'), + ), + ] From edaa7d30bfbc339c4af2ee8ecf34fcd004d0751a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Wed, 28 Dec 2016 10:24:34 -0200 Subject: [PATCH 8/9] Add files via upload --- sapl/sessao/migrations/0031_merge.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sapl/sessao/migrations/0031_merge.py diff --git a/sapl/sessao/migrations/0031_merge.py b/sapl/sessao/migrations/0031_merge.py new file mode 100644 index 000000000..409f8be4d --- /dev/null +++ b/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 = [ + ] From 54a55b2f7a9ad9e21125f4ec85e353a16f970b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Wed, 28 Dec 2016 10:36:07 -0200 Subject: [PATCH 9/9] Add files via upload --- .../migrations/0030_auto_20161215_1652.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sapl/sessao/migrations/0030_auto_20161215_1652.py diff --git a/sapl/sessao/migrations/0030_auto_20161215_1652.py b/sapl/sessao/migrations/0030_auto_20161215_1652.py new file mode 100644 index 000000000..a804fa820 --- /dev/null +++ b/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'), + ), + ]