42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from rest_framework import viewsets
|
|
from rest_framework.parsers import MultiPartParser, FormParser, JSONParser
|
|
|
|
from web.models import TrainingSensitiveWord
|
|
from web.serializers import TrainingSensitiveWordSerializer
|
|
|
|
|
|
class TrainingSensitiveWordSerializerViewSet(viewsets.ModelViewSet):
|
|
"""
|
|
CRUD 功能
|
|
"""
|
|
authentication_classes = []
|
|
permission_classes = []
|
|
|
|
# 解析方式
|
|
parser_classes = (MultiPartParser, FormParser, JSONParser)
|
|
|
|
queryset = TrainingSensitiveWord.objects.all()
|
|
serializer_class = TrainingSensitiveWordSerializer
|
|
|
|
def create(self, request, *args, **kwargs):
|
|
"""新建一条音乐"""
|
|
pass
|
|
|
|
def list(self, request, *args, **kwargs):
|
|
"""全部音乐数据"""
|
|
pass
|
|
|
|
def retrieve(self, request, *args, **kwargs):
|
|
"""查询一条数据"""
|
|
pass
|
|
|
|
def update(self, request, *args, **kwargs):
|
|
"""更新一条音乐数据"""
|
|
pass
|
|
|
|
def destroy(self, request, *args, **kwargs):
|
|
"""删除一条数据"""
|
|
pass |