city查询参数
This commit is contained in:
parent
cfa91f4684
commit
70bd6492df
|
|
@ -36,6 +36,8 @@ from .serializers import (CitySerializer, DictSerializer, DictTypeSerializer, Fi
|
||||||
PositionSerializer, ProvinceSerializer, RoleSerializer,
|
PositionSerializer, ProvinceSerializer, RoleSerializer,
|
||||||
UserCreateSerializer, UserListSerializer,
|
UserCreateSerializer, UserListSerializer,
|
||||||
UserModifySerializer)
|
UserModifySerializer)
|
||||||
|
from django.utils.decorators import method_decorator
|
||||||
|
from django.views.decorators.cache import cache_page
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
from rest_framework.exceptions import AuthenticationFailed
|
from rest_framework.exceptions import AuthenticationFailed
|
||||||
|
|
@ -426,6 +428,9 @@ class ProviceViewSet(PageOrNot, ListModelMixin, GenericViewSet):
|
||||||
search_fields = ['name']
|
search_fields = ['name']
|
||||||
ordering = 'id'
|
ordering = 'id'
|
||||||
|
|
||||||
|
@method_decorator(cache_page(60*60*2))
|
||||||
|
def list(self, request, *args, **kwargs):
|
||||||
|
return super().list(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class CityViewSet(PageOrNot, ListModelMixin, GenericViewSet):
|
class CityViewSet(PageOrNot, ListModelMixin, GenericViewSet):
|
||||||
|
|
@ -435,6 +440,9 @@ class CityViewSet(PageOrNot, ListModelMixin, GenericViewSet):
|
||||||
search_fields = ['name']
|
search_fields = ['name']
|
||||||
ordeing = 'id'
|
ordeing = 'id'
|
||||||
|
|
||||||
|
@method_decorator(cache_page(60*60*2))
|
||||||
|
def list(self, request, *args, **kwargs):
|
||||||
|
return super().list(request, *args, **kwargs)
|
||||||
|
|
||||||
class FileViewSet(ModelViewSet):
|
class FileViewSet(ModelViewSet):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue