diff --git a/sapl/api/views.py b/sapl/api/views.py index eb58616dc..ce269ba51 100644 --- a/sapl/api/views.py +++ b/sapl/api/views.py @@ -457,6 +457,8 @@ class _ProposicaoViewSet(): @customize(MateriaLegislativa) class _MateriaLegislativaViewSet: + class Meta: + ordering = ['-ano', 'tipo', 'numero'] @action(detail=True, methods=['GET']) def ultima_tramitacao(self, request, *args, **kwargs): diff --git a/sapl/materia/models.py b/sapl/materia/models.py index ba7626a24..d45252767 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -312,7 +312,7 @@ class MateriaLegislativa(models.Model): verbose_name = _('Matéria Legislativa') verbose_name_plural = _('Matérias Legislativas') unique_together = (("tipo", "numero", "ano"),) - ordering = ['-id'] + ordering = ['-ano', 'tipo', 'numero'] permissions = (("can_access_impressos", "Can access impressos"),) def __str__(self):