cquery try 一下
This commit is contained in:
parent
f942540b49
commit
d961a02378
|
@ -46,6 +46,10 @@ class CustomGenericViewSet(MyLoggingMixin, GenericViewSet):
|
||||||
return super().get_serializer_class()
|
return super().get_serializer_class()
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
try:
|
||||||
|
self.cquery_serializer_class = self.list_serializer_class if self.list_serializer_class else self.serializer_class
|
||||||
|
except:
|
||||||
|
pass
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
if self.perms_map:
|
if self.perms_map:
|
||||||
for k, v in self.perms_map.items():
|
for k, v in self.perms_map.items():
|
||||||
|
@ -134,7 +138,6 @@ class CustomModelViewSet(CreateModelMixin, UpdateModelMixin, ListModelMixin,
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, **kwargs) -> None:
|
def __init__(self, **kwargs) -> None:
|
||||||
self.cquery_serializer_class = self.list_serializer_class if self.list_serializer_class else self.serializer_class
|
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
# 增加默认权限标识
|
# 增加默认权限标识
|
||||||
if not self.perms_map:
|
if not self.perms_map:
|
||||||
|
|
Loading…
Reference in New Issue