views.py 346 B

12345678910111213
  1. from django.shortcuts import render
  2. # Create your views here.
  3. from rest_framework.viewsets import ModelViewSet
  4. from basic.models import Menu
  5. from basic.serializers import MenuSerializer
  6. class MenuView(ModelViewSet):
  7. queryset = Menu.objects.all()
  8. serializer_class = MenuSerializer # 序列化
  9. pagination_class = None