Django DRF Notes(第四章)
00 分钟
2024-4-29
2024-11-15
type
status
date
slug
summary
tags
category
password

4:Django DRF:视图

目录

DRF类视图介绍

APIView类

Request与Response

GenerAPIView类

ViewSet类

ModelViewSet类

4.1:DRF类视图介绍

notion image

4.2:APIView类

4.3:Request和Response

notion image

4.4:GenericAPIView类

notion image
notion image
notion image

4.5:ViewSet类

notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image

4.6:ModeViewSet类

notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
动作
类名
HTTP方法
说明
URL示例
retrieve
mixins.RetrieveModelMixin
GET
获取单数据,需要携带pk
list
mixins.ListModelMixin
GET
获取多条数据
create
mixins.CreateModelMixin
POST
创建数据
update
mixins.UpdateModelMixin
PUT
更新数据,需要携带pk
destroy
mixins.DestroyModelMixin
DELETE
删除数据,需要携带pk
notion image
notion image
上一篇
Django DRF Notes(第五章)
下一篇
Django DRF Notes(第三章)