Restrict fields returned by DRF serializers
Project description
Features
Restrict fields returned by DRF serializers using the only query parameter
GET http://127.0.0.1:8000/api/users/?only=id&only=name
Serialize only the id and name fields.
{
"count": 198,
"next": "http://127.0.0.1:8000/api/users/?only=id&only=name&page=1",
"previous": null,
"results":[
{
"id": 1,
"name": "Test"
},
...
],
}
Defer fields returned by DRF serializers using the defer query parameter
GET http://127.0.0.1:8000/api/users/?defer=name&defer=age
Serialize only the id and name fields.
{
"count": 198,
"next": "http://127.0.0.1:8000/api/users/?defer=name&defer=age&page=1",
"previous": null,
"results":[
{
"id": 1,
},
...
],
}
Free software: MIT license
Documentation: https://drf-restricted-fields.readthedocs.io.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for drf_restricted_fields-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1539e85a47de6f0c4bac3fbefd531be66a2166710a022123b6ff0ac3895d095 |
|
MD5 | e3dccb7fb9318552443e0934acba0bd7 |
|
BLAKE2b-256 | 5fc2a748c4456276fdba233ac526116a0a040e86c0a6daeb430205aa14a79b88 |
Close
Hashes for drf_restricted_fields-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dd9d0ad89044fa45c1132432fc98fcee7b9249fb321f4d5947bfdc41b3e0a94 |
|
MD5 | ddaeb9b0fd240fed1b32ee0339213a62 |
|
BLAKE2b-256 | f7fffcdba065be7d637629eaeaa4c0455cd67fd1f89f2dc0b1c5111da230b2bf |