This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Extended serializers for Django modified for OpenProximity

Project Description

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.
Release History

Release History

This version
History Node

1.1.1

History Node

1.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
wadofstuff-django-serializers-op-1.1.1.tar.gz (5.6 kB) Copy SHA256 Checksum SHA256 Source Oct 18, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting