修改排序

This commit is contained in:
caoqianming 2020-12-30 17:48:53 +08:00
parent 8006064c61
commit a960ee6a88
1 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ class CMAViewSet(RecordMixin, ModelViewSet):
search_fields = ['bzbh', 'bzmc', 'sszx', 'xmmc', 'glzz', 'dlmc'] search_fields = ['bzbh', 'bzmc', 'sszx', 'xmmc', 'glzz', 'dlmc']
filterset_fields = ['sszx', 'type', 'glzz'] filterset_fields = ['sszx', 'type', 'glzz']
ordering_fields = ['sszx', 'dlxh', 'lbxh', 'xmxh'] ordering_fields = ['sszx', 'dlxh', 'lbxh', 'xmxh']
ordering = ['sszx', 'dlxh', 'lbxh', 'xmxh'] ordering = ['create_time']
@action(methods=['get'], detail=False,url_name='cma_group_by', perms_map = {'*':'*'}) @action(methods=['get'], detail=False,url_name='cma_group_by', perms_map = {'*':'*'})
def group(self, request, pk=None): def group(self, request, pk=None):
@ -230,7 +230,7 @@ class InspectionViewSet(ModelViewSet):
serializer_class = InspectionSerializer serializer_class = InspectionSerializer
search_fields = ['dlmc', 'jydx', 'dxxh','jyxmmc','jybz','sszx','sm'] search_fields = ['dlmc', 'jydx', 'dxxh','jyxmmc','jybz','sszx','sm']
ordering_fields = ['dlmc'] ordering_fields = ['dlmc']
ordering = 'dlmc' ordering = ['create_time']
filterset_fields = ['sszx'] filterset_fields = ['sszx']
@action(methods=['post'], detail=False, url_path='deletes', url_name='inspection_deletes', perms_map = {'post':'inspection_deletes'}) @action(methods=['post'], detail=False, url_path='deletes', url_name='inspection_deletes', perms_map = {'post':'inspection_deletes'})
def deletes(self, request): def deletes(self, request):
@ -303,7 +303,7 @@ class CNASViewSet(ModelViewSet):
search_fields = ['bzbh', 'bzmc', 'sszx', 'xmmc', 'bztk'] search_fields = ['bzbh', 'bzmc', 'sszx', 'xmmc', 'bztk']
ordering_fields = ['bzmc'] ordering_fields = ['bzmc']
filterset_fields = ['sszx'] filterset_fields = ['sszx']
ordering = 'bzmc' ordering = ['create_time']
@action(methods=['get'], detail=False,url_name='cnas_group_by', perms_map = {'*':'*'}) @action(methods=['get'], detail=False,url_name='cnas_group_by', perms_map = {'*':'*'})
def group(self, request, pk=None): def group(self, request, pk=None):