From a2f9554cb602de10e0b24bcb1febdfe04163828b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Cantu=C3=A1ria?= Date: Fri, 13 Mar 2020 13:54:08 -0300 Subject: [PATCH] =?UTF-8?q?Adiciona=20ordena=C3=A7=C3=A3o=20de=20Assunto?= =?UTF-8?q?=20Mat=C3=A9ria=20por=20ordem=20alfab=C3=A9tica=20(#3125)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0065_auto_20200313_1137.py | 23 +++++++++++++++++++ sapl/materia/models.py | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 sapl/materia/migrations/0065_auto_20200313_1137.py diff --git a/sapl/materia/migrations/0065_auto_20200313_1137.py b/sapl/materia/migrations/0065_auto_20200313_1137.py new file mode 100644 index 000000000..9c6c8d5d5 --- /dev/null +++ b/sapl/materia/migrations/0065_auto_20200313_1137.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.27 on 2020-03-13 14:37 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0064_auto_20200114_1121'), + ] + + operations = [ + migrations.AlterModelOptions( + name='assuntomateria', + options={'ordering': ('assunto', 'dispositivo'), 'verbose_name': 'Assunto de Matéria', 'verbose_name_plural': 'Assuntos de Matéria'}, + ), + migrations.AlterModelOptions( + name='materiaassunto', + options={'ordering': ('assunto__assunto', '-materia'), 'verbose_name': 'Relação Matéria - Assunto', 'verbose_name_plural': 'Relações Matéria - Assunto'}, + ), + ] diff --git a/sapl/materia/models.py b/sapl/materia/models.py index b3fff4851..614426916 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -487,6 +487,7 @@ class AssuntoMateria(models.Model): class Meta: verbose_name = _('Assunto de Matéria') verbose_name_plural = _('Assuntos de Matéria') + ordering = ('assunto', 'dispositivo') def __str__(self): return self.assunto @@ -618,6 +619,7 @@ class MateriaAssunto(models.Model): class Meta: verbose_name = _('Relação Matéria - Assunto') verbose_name_plural = _('Relações Matéria - Assunto') + ordering = ('assunto__assunto', '-materia') def __str__(self): return _('%(materia)s - %(assunto)s') % {