From 1ca31a0f39ae75214d143044848892d651450e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Mon, 4 Sep 2017 19:25:36 -0300 Subject: [PATCH] Ordena assunto norma e coloca esfera na ordem do sapl 25 (#1449) * Ordena assunto norma e coloca esfera na ordem do sapl 25 * adiciona migrations --- .../migrations/0007_auto_20170904_1708.py | 24 +++++++++++++++++++ sapl/norma/models.py | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 sapl/norma/migrations/0007_auto_20170904_1708.py diff --git a/sapl/norma/migrations/0007_auto_20170904_1708.py b/sapl/norma/migrations/0007_auto_20170904_1708.py new file mode 100644 index 000000000..f353342ff --- /dev/null +++ b/sapl/norma/migrations/0007_auto_20170904_1708.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2017-09-04 17:08 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('norma', '0006_normajuridica_data_ultima_atualizacao'), + ] + + operations = [ + migrations.AlterModelOptions( + name='assuntonorma', + options={'ordering': ['assunto'], 'verbose_name': 'Assunto de Norma Jurídica', 'verbose_name_plural': 'Assuntos de Normas Jurídicas'}, + ), + migrations.AlterField( + model_name='normajuridica', + name='esfera_federacao', + field=models.CharField(choices=[('M', 'Municipal'), ('E', 'Estadual'), ('F', 'Federal')], max_length=1, verbose_name='Esfera Federação'), + ), + ] diff --git a/sapl/norma/models.py b/sapl/norma/models.py index 5f92f8a59..d00be8ce7 100644 --- a/sapl/norma/models.py +++ b/sapl/norma/models.py @@ -20,6 +20,7 @@ class AssuntoNorma(models.Model): class Meta: verbose_name = _('Assunto de Norma Jurídica') verbose_name_plural = _('Assuntos de Normas Jurídicas') + ordering = ['assunto'] def __str__(self): return self.assunto @@ -67,9 +68,9 @@ def norma_upload_path(instance, filename): @reversion.register() class NormaJuridica(models.Model): ESFERA_FEDERACAO_CHOICES = Choices( + ('M', 'municipal', _('Municipal')), ('E', 'estadual', _('Estadual')), ('F', 'federal', _('Federal')), - ('M', 'municipal', _('Municipal')), ) texto_integral = models.FileField(