CBV设计模式
dandanfengyun
这个作者很懒,什么都没留下…
展开
-
django CBV 设计模式
FBV(function base views) 就是在视图里使用函数处理请求。 CBV(class base views) 就是在视图里使用类处理请求。 视图函数中代码 from django.http import JsonResponse, QueryDict from django.shortcuts import render # Create your views here. fro...原创 2018-12-03 20:25:13 · 353 阅读 · 0 评论 -
restful中APIView简单使用
restful中APIView参数简单使用 个人复习使用 要对序列化器有一定了解 CVB设计views简单使用 序列化器简单使用 我们未使用restful设计之前使用的是from django.views import View 在类中获取参数为 request.GET 等 from rest_framework.views import APIView 对 View做了封装 使用 稍有不同 c...原创 2018-12-03 21:16:12 · 2185 阅读 · 1 评论