I'm working on a Django-based web service and I'm trying to figure out what the best way to do my serialization will be.
The tricky requirement, though, is that I'd like to have pretty much full control over format of, and fields contained in, the response.
For example, the Django serializers (which, unfortunately, includes the wadofstuff serializer) automatically wrap the fields in { model: "app.Model", pk: 42, fields: { ... }}
, which is great for creating fixtures, but isn't great for me — I'd like full control over the output.
Additionally, I'd like a serializer that is aware of Django's objects so, for example, it will do the Right Thing with a QuerySet
or ManyToManyField
.
Currently I'm thinking of using django-piston's emitters.py, but my experience with django-piston has only been mediocreª, so I'd like to see if there are other options.
So, are there any other options for customizable Django serializers?
ª: It's sparsely documented and tested, and I've had some problems with the serializer.