Skip to main content

drf-restricted-fields

https://img.shields.io/pypi/v/drf_restricted_fields.svg https://github.com/tj-django/drf-restricted-fields/actions/workflows/test.yml/badge.svg Documentation Status Updates

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,
        },
        ...
    ],
}

Metadata

Release files for drf-restricted-fields 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drf-restricted-fields 0.0.1
File Size Uploaded Provenance
drf_restricted_fields-0.0.1.tar.gz 6.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for drf-restricted-fields 0.0.1
File Interpreter ABI Platform
drf_restricted_fields-0.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 11.7 kB

Release files / drf_restricted_fields-0.0.1.tar.gz

Download URL drf_restricted_fields-0.0.1.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c1539e85a47de6f0c4bac3fbefd531be66a2166710a022123b6ff0ac3895d095
BLAKE2b-256 checksum
How to use checksums
5fc2a748c4456276fdba233ac526116a0a040e86c0a6daeb430205aa14a79b88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.0 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/2.7.16

Release files / drf_restricted_fields-0.0.1-py2.py3-none-any.whl

Download URL drf_restricted_fields-0.0.1-py2.py3-none-any.whl
Size 4.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2dd9d0ad89044fa45c1132432fc98fcee7b9249fb321f4d5947bfdc41b3e0a94
BLAKE2b-256 checksum
How to use checksums
f7fffcdba065be7d637629eaeaa4c0455cd67fd1f89f2dc0b1c5111da230b2bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.0 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/2.7.16

Security for drf-restricted-fields 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page