Browse Source

Adiciona ordenação explícita em Matéria Legislativa (#3253)

pull/3259/head
Vinícius Cantuária 4 years ago
committed by GitHub
parent
commit
1039d4cada
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      sapl/api/views.py
  2. 2
      sapl/materia/models.py

2
sapl/api/views.py

@ -457,6 +457,8 @@ class _ProposicaoViewSet():
@customize(MateriaLegislativa) @customize(MateriaLegislativa)
class _MateriaLegislativaViewSet: class _MateriaLegislativaViewSet:
class Meta:
ordering = ['-ano', 'tipo', 'numero']
@action(detail=True, methods=['GET']) @action(detail=True, methods=['GET'])
def ultima_tramitacao(self, request, *args, **kwargs): def ultima_tramitacao(self, request, *args, **kwargs):

2
sapl/materia/models.py

@ -312,7 +312,7 @@ class MateriaLegislativa(models.Model):
verbose_name = _('Matéria Legislativa') verbose_name = _('Matéria Legislativa')
verbose_name_plural = _('Matérias Legislativas') verbose_name_plural = _('Matérias Legislativas')
unique_together = (("tipo", "numero", "ano"),) unique_together = (("tipo", "numero", "ano"),)
ordering = ['-id'] ordering = ['-ano', 'tipo', 'numero']
permissions = (("can_access_impressos", "Can access impressos"),) permissions = (("can_access_impressos", "Can access impressos"),)
def __str__(self): def __str__(self):

Loading…
Cancel
Save