From a6d6e1ff5a866489f84b2fc5a7a3f50002dbcf17 Mon Sep 17 00:00:00 2001 From: kovacspe Date: Sat, 14 Dec 2024 23:10:54 +0100 Subject: [PATCH] Ordering fix (#478) --- cms/views.py | 2 +- competition/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cms/views.py b/cms/views.py index 9a3ab8e..f908863 100644 --- a/cms/views.py +++ b/cms/views.py @@ -54,7 +54,7 @@ class PostViewSet(viewsets.ModelViewSet): filterset_fields = ['sites'] search_fields = ['caption', 'short_text', 'details'] ordering_fields = ['added_at', 'visible_until', 'visible_after'] - ordering = ['added_at'] + ordering = ['-added_at'] @action(detail=False) def visible(self, request): diff --git a/competition/models.py b/competition/models.py index 140204d..5ed9344 100644 --- a/competition/models.py +++ b/competition/models.py @@ -285,7 +285,7 @@ class Series(models.Model): class Meta: verbose_name = 'séria' verbose_name_plural = 'série' - ordering = ['semester', '-order', ] + ordering = ['semester', 'order', ] semester = models.ForeignKey( Semester, verbose_name='semester', on_delete=models.CASCADE)