wadofstuff-django-serializers 1.1.0

Extended serializers for Django
wadofstuff.django.serializers is a Python module that 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
 }
 }
 ]
 }
 }
 ]

last updated on:
March 9th, 2011, 11:42 GMT
price:
FREE!
developed by:
Matthew Flanagan
homepage:
code.google.com
license type:
BSD License 
category:
ROOT \ Internet \ HTTP (WWW)

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

What's New in This Release:
  • Added support for "natural keys" as implemented in Django.
read full changelog

Add your review!

SUBMIT