From 820f316511087a3cfcfda918d7c42f6295ab202d Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 28 Feb 2024 16:34:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20envdata=E5=9B=A0=E6=9C=AA=E9=85=8D?= =?UTF-8?q?=E7=BD=AEordering=E8=A7=A6=E5=8F=91bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/enp/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/enp/views.py b/apps/enp/views.py index 593b24d0..e6f30af0 100644 --- a/apps/enp/views.py +++ b/apps/enp/views.py @@ -121,6 +121,8 @@ class EnvDataViewSet(ListModelMixin, CustomGenericViewSet): "time": ['exact', 'gte', 'lte', 'year', 'month', 'day'], "equipment": ['exact'], } + ordering_fields = ['time'] + ordering = ['-time'] @action(methods=['post'], detail=False, perms_map={'post': '*'}, serializer_class=EnvDataExportSerializer)