django 之(三) --- GenericAPIView

2021-01-28 03:15

阅读:779

标签:bsp   **kwargs   war   nbsp   query   serial   增删改   pos   django   

GenericAPIView

   继承自 APIView

GenericAPIView

  • CreateAPIView(mixins.CreateModelMixin,GenericAPIView)
    • create() 、queryset = None serializer_class = None
    •   def post(self, request, *args, **kwargs):
    •   return self.create(request, *args, **kwargs)
  • ListAPIView(mixins.ListModelMixin,GenericAPIView)
  • RetrieveAPIView(mixins.RetrieveModelMixin,GenericAPIView)
  • DestroyAPIView(mixins.DestroyModelMixin,GenericAPIView)
  • UpdateAPIView(mixins.UpdateModelMixin,GenericAPIView)
  • ListCreateAPIView(mixins.CreateModelMixin,mixins.ListModelMixin,GenericAPIView)
  • RetrieveUpdateAPIView(mixins.RetrieveModelMixin,mixins.UpdateModelMixin,GenericAPIView)
  • RetrieveDestroyAPIView(mixins.RetrieveModelMixin, mixins.DestroyModelMixin,GenericAPIView)
  • ModelViewSet 增删改查

 

 

 

 

 

django 之(三) --- GenericAPIView

标签:bsp   **kwargs   war   nbsp   query   serial   增删改   pos   django   

原文地址:https://www.cnblogs.com/TMMM/p/11913341.html


评论


亲,登录后才可以留言!