Django REST框架的可扩展序列化程序
django-rest-framework-expandable的Python项目详细描述
Django Rest框架可扩展
说明
Django REST框架的可扩展序列化程序。允许选择对象 通过查询参数或序列化程序类kwargs进行扩展。在
安装
pip install django-rest-framework-expandable
使用
^{pr2}$返回。。。在
GET http://localhost:8000/api/examples/?expand=example.user
{
id: 1,
another_related_field: "http://localhost:8000/api/another/1",
user: {
id: 1,
username: "Alex",
...
}
}
- 项目
标签: