Skip to main content

Note: This is a clone of [1] modified with some patches from OpenProximity

[1] http://code.google.com/p/wadofstuff/source/browse/#svn%2Ftrunk%2Fpython%2Fserializer

Extended Django Serializer Module

The wadofstuff.django.serializers python module extends Django’s built-in serializers, adding 3 new capabilities inspired by the Ruby on Rails JSON serializer. These parameters allow the developer more control over how their models are serialized.

The additional capabilities are:

  • excludes - a list of fields to be excluded from serialization. The excludes list takes precedence over the fields argument.

  • extras - a list of non-model field properties or callables to be serialized.

  • relations - a list or dictionary of model related fields to be followed and serialized.

Example of serializing a relation

>>> serializers.serialize('json', Group.objects.all(), indent=4, relations=('permissions',))
[
    {
        "pk": 2,
        "model": "auth.group",
        "fields": {
            "name": "session",
            "permissions": [
                {
                    "pk": 19,
                    "model": "auth.permission",
                    "fields": {
                        "codename": "add_session",
                        "name": "Can add session",
                        "content_type": 7
                    }
                }
            ]
        }
    }
]

What’s new

Version 1.1.0:

  • Added support for “natural keys” as implemented in Django.

Version 1.0.0:

  • First public release.

Metadata

Release files for wadofstuff-django-serializers-op 1.1.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 wadofstuff-django-serializers-op 1.1.1
File Size Uploaded Provenance Actions
wadofstuff-django-serializers-op-1.1.1.tar.gz 5.6 kB Without provenance Details for wadofstuff-django-serializers-op-1.1.1.tar.gz

Release files / wadofstuff-django-serializers-op-1.1.1.tar.gz

Download URL wadofstuff-django-serializers-op-1.1.1.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6fc63b9cfdf75a266acf4072422b6b6cf0c904f1ad4dbca69cf01189d1085fbc
BLAKE2b-256 checksum
How to use checksums
86eb4ab2e594a3283d4d9253f7918b36309dcdb2c3aecdbbfdeb938b7f3eb252
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for wadofstuff-django-serializers-op 1.1.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

1.1.1 This release

1 release file 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