• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
近知
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2021年12月10日

视图集
摘要: 视图集 ModelViewSet继承了5个视图扩展类和GenericViewSet class ModelViewSet(mixins.CreateModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.Destr 阅读全文
posted @ 2021-12-10 16:28 近知 阅读(33) 评论(0) 推荐(0)
 
Request对象和Response对象
摘要: Request里面有_authenticate方法,user,auth,data这几个方法被装饰成了属性,当取前两个属性的值的时候,如果有这个属性,就直接返回它的值 self._user self._auth,如果没有这个属性,就调用_authenticate方法,源码参见: https://www 阅读全文
posted @ 2021-12-10 16:24 近知 阅读(66) 评论(0) 推荐(0)
 
APIView源码分析
摘要: from rest_framework.views import APIView class APIView(View): ... @classmethod def as_view(cls, **initkwargs): ... # super方法调用父类(也就是View)的as_view方法,这个 阅读全文
posted @ 2021-12-10 16:21 近知 阅读(46) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3