Skip to main content

Presto DRF

Integration package for using django-rest-framework with prestojs

Installation

pip install presto_drf

API

Mixins

SerializerOptInFieldsMixin

Regulates fields exposed on a Serializer by default & as requested based on query parameters or context.

  • Pass 'include_fields' / 'opt_in_fields' thru query params or context to use.
  • multiple fields can either be separated by comma eg, /?include_fields=first_name,email&opt_in_fields=gait_recognition_prediction
  • or passed in the traditional list fashion eg, /?include_fields=first_name&include_fields=email&opt_in_fields=gait_recognition_prediction
  • or mixed eg, /?include_fields=first_name,email&include_fields=boo
  • By default, all "fields" defined in serializer, minus those listed in "opt_in_fields" would be returned.
  • If "include_fields" is supplied, only fields requested this way would be returned.
  • If "opt_in_fields" is supplied, fields requested this way PLUS fields from #1 or #2 would be returned.
  • Pinned fields are always returned (defaults to primary key)

Usage:

class UserSerializer(SerializerOptInFieldsMixin, ModelSerializer):
    class Meta:
        model = User
        fields = (
            "id",
            "first_name",
            "last_name",
            "email",
            "region",
            "activated_at",
            "is_staff",
        )
        # These fields only returned if explicitly requested
        opt_in_only_fields = ["activated_at", "is_staff"]

Metadata

Release files for presto-drf 0.0.2

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

Source distribution (sdist)

Source distribution for presto-drf 0.0.2
File Size Uploaded Provenance Actions
presto_drf-0.0.2.tar.gz 4.3 kB Without provenance Details for presto_drf-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for presto-drf 0.0.2
File Interpreter ABI Platform Actions
presto_drf-0.0.2-py3-none-any.whl Python 3 none any Details for presto_drf-0.0.2-py3-none-any.whl

Total release size: 10.5 kB

Release files / presto_drf-0.0.2.tar.gz

Download URL presto_drf-0.0.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ba2ff9972f04037f8abec56f7f4d45e9a5a974600ebb6f17fd114ff02379cd01
BLAKE2b-256 checksum
How to use checksums
bdef88630bb5f683beced31fc68da6da34b03caf1a2f5e874598bc27bbc2a03f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.1 CPython/3.6.9

Release files / presto_drf-0.0.2-py3-none-any.whl

Download URL presto_drf-0.0.2-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ddc3d59878ba96217e6711fc5dbbbfac69f345cc8c057b40baa3a566f331dad4
BLAKE2b-256 checksum
How to use checksums
5721e60f80c1ce73c2ef2376ed8d5785d32345cfae7eea68312e0ca61a762bae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.1 CPython/3.6.9

Security for presto-drf 0.0.2

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.2 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