Latest commit 6ef6ae9 Mar 5, 2012 mattimustang Port fix for Django issue #17717
Permalink
..
Failed to load latest commit information.
wadofstuff Port fix for Django issue #17717 Mar 5, 2012
AUTHORS
ChangeLog
INSTALL relocated serializers into own code tree so and add setup.py LICENSE … May 23, 2009
LICENSE
MANIFEST.in relocated serializers into own code tree so and add setup.py LICENSE … May 23, 2009
README
setup.py Bumping serializer version to 1.1.0. Mar 7, 2011

README

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