feat: enm enstat调整一下排序

This commit is contained in:
caoqianming 2024-12-06 17:26:08 +08:00
parent 152b0b5a3a
commit 05beed5146
1 changed files with 4 additions and 4 deletions

View File

@ -160,8 +160,8 @@ class MpointStatViewSet(BulkCreateModelMixin, BulkDestroyModelMixin, CustomListM
serializer_class = MpointStatSerializer
select_related_fields = ["mpoint", "mpoint__ep_monitored", "mpoint__ep_belong", "mgroup", "mgroup__belong_dept"]
filterset_class = MpointStatFilter
ordering_fields = ['mpoint__report_sortstr', 'year', 'month', 'day', 'hour', 'year_s', 'month_s', 'day_s', 'mgroup__sort', 'create_time']
ordering = ["mpoint__report_sortstr", "-year", "-month", "-day", "-hour", "-year_s", "-month_s", "-day_s", "mgroup__sort", "-create_time"]
ordering_fields = ['mpoint__report_sortstr', 'year', 'month', 'day', 'hour', 'year_s', 'month_s', 'day_s', 'mgroup__sort', 'create_time', "update_time"]
ordering = ["mpoint__report_sortstr", "-year", "-month", "-day", "-hour", "-year_s", "-month_s", "-day_s", "mgroup__sort"]
def perform_create(self, serializer):
ins = serializer.save()
@ -239,8 +239,8 @@ class EnStatViewSet(CustomListModelMixin, CustomGenericViewSet):
serializer_class = EnStatSerializer
select_related_fields = ["mgroup", "team", "mgroup__belong_dept"]
filterset_class = EnStatFilter
ordering = ["mgroup__sort", "year_s", "month_s", "day_s", "hour"]
ordering_fields = ["mgroup__sort", "year_s", "month_s", "day_s", "hour", "update_time"]
ordering = ["mgroup__sort", "year", "month", "day", "hour", "year_s", "month_s", "day_s"]
ordering_fields = ["mgroup__sort", "year_s", "month_s", "day_s", "hour", "update_time", "create_time"]
@action(methods=["post"], detail=False, perms_map={"post": "*"}, serializer_class=EnStatAnaSerializer)
def analyze(self, request, *args, **kwargs):