feat: ResignationViewSet添加RetrieveModelMixin

This commit is contained in:
caoqianming 2025-11-08 22:38:45 +08:00
parent 0c97939165
commit 030f3c62de
1 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ from apps.third.dahua import dhClient
from apps.third.tapis import dhapis from apps.third.tapis import dhapis
from apps.utils.export import export_excel from apps.utils.export import export_excel
from apps.utils.viewsets import CustomGenericViewSet, CustomModelViewSet from apps.utils.viewsets import CustomGenericViewSet, CustomModelViewSet
from apps.utils.mixins import BulkCreateModelMixin, BulkDestroyModelMixin, CustomListModelMixin from apps.utils.mixins import BulkCreateModelMixin, BulkDestroyModelMixin, CustomListModelMixin, RetrieveModelMixin
epTypeOptions = {'employee': '正式员工', 'remployee': '相关方', epTypeOptions = {'employee': '正式员工', 'remployee': '相关方',
'visitor': '访客', 'driver': '货车司机'} 'visitor': '访客', 'driver': '货车司机'}
@ -393,7 +393,7 @@ class CertificateViewSet(CustomModelViewSet):
ins.get_state(need_update=True) ins.get_state(need_update=True)
class ResignationViewSet(CustomListModelMixin, BulkCreateModelMixin, CustomGenericViewSet): class ResignationViewSet(CustomListModelMixin, BulkCreateModelMixin, RetrieveModelMixin, CustomGenericViewSet):
perms_map = {"get": "*", "post": "resignation.create"} perms_map = {"get": "*", "post": "resignation.create"}
select_related_fields = ['employee', 'employee__belong_dept', 'employee__post'] select_related_fields = ['employee', 'employee__belong_dept', 'employee__post']
queryset = Resignation.objects.all() queryset = Resignation.objects.all()