序列化API中部分字段的子集
项目描述
允许客户端控制API响应中要发送的字段。字段在查询中指定,例如。
# You want a list of users but you're only interested in the fields "id" and "username":
GET /users/?fields=id,username
[
{
"id": 1,
"username": "tom"
},
{
"id": 2,
"username": "wim"
}
]
# You want to see every field except "id" for the specific user wim:
GET /users/2/?fields!=id
{
"username": "wim",
"email": "hey@wimglenn.com",
"spirit_animal": "raccoon"
}
支持的Django版本: 1.7 - 3.2+. 有关详细信息,请参阅CI矩阵。
文档托管在Read The Docs。
开发者,开发者,开发者!
想要为项目做出贡献?这是运行测试套件的方式
# get the codez
git clone https://github.com/wimglenn/djangorestframework-queryfields.git
# create and/or activate your virtualenv, this or something like it:
cd djangorestframework-queryfields
python3 -m venv .venv
source .venv/bin/activate
# installing the app in your venv
pip install --editable ".[dev]"
git checkout -b myfeature
# hack away, then ...
pytest
项目详情
关闭
djangorestframework-queryfields-1.1.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 512516947e2d0f7b132469bc3b96b702653ed032e450d90b6efc0dc7fe031ef7 |
|
MD5 | 2a795444c3233fb9e4014320d623ce19 |
|
BLAKE2b-256 | b8838c168b6169783c41c485068ef4a606e78461c09c4ee9a04fb986c6b83c41 |
关闭
djangorestframework_queryfields-1.1.0-py2.py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3952e02fd800de34a0fc64963bcaf7eb1e9ad688f120b1bca5b261843323f36e |
|
MD5 | ca19a914bb2d752b7f4a1929a1aab700 |
|
BLAKE2b-256 | 319c725493f7939ee5dc49f837b9655beb4f924c723ecc54d641539d15b47e4a |