- from django.shortcuts import render
- # Create your views here.
- from rest_framework.viewsets import ModelViewSet
- from basic.models import Menu
- from basic.serializers import MenuSerializer
- class MenuView(ModelViewSet):
- queryset = Menu.objects.all()
- serializer_class = MenuSerializer # 序列化
- pagination_class = None
|