eventcate create

This commit is contained in:
caoqianming 2022-06-17 17:22:19 +08:00
parent 67aa0e510f
commit 3b412c62bd
1 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ from apps.ecm.models import Event, EventCate, Remind, NotifySetting
from apps.ecm.serializers import (EventCateListSerializer, EventCateUpdateSerializer, EventHandleSerializer,
EventSerializer, RemindSerializer, NotifySettingsSerializer)
from apps.utils.viewsets import CustomGenericViewSet, CustomModelViewSet
from rest_framework.mixins import UpdateModelMixin, ListModelMixin, RetrieveModelMixin
from rest_framework.mixins import UpdateModelMixin, ListModelMixin, RetrieveModelMixin, CreateModelMixin
from django.db import transaction
from rest_framework.decorators import action
from rest_framework import serializers
@ -12,8 +12,8 @@ from rest_framework.response import Response
# Create your views here.
class EventCateViewSet(UpdateModelMixin, ListModelMixin, CustomGenericViewSet):
perms_map = {'put': 'eventcate:update'}
class EventCateViewSet(CreateModelMixin, UpdateModelMixin, ListModelMixin, CustomGenericViewSet):
perms_map = {'put': 'event_cate:update', 'post': 'event_cate:create'}
queryset = EventCate.objects.all()
list_serializer_class = EventCateListSerializer
update_serializer_class = EventCateUpdateSerializer