Seeing another proposal for Customizable Serialization for the GSoC this
prompted me to dust off the bits of work I've done along similar lines.
I'd really like to see this get properly addressed in core and I thought it
was about time I helped to make it happen.
I've made a fairly comprehensive start, and pushed the results of what I
to date as the `django-serializers` project. It's available on PyPI, and
source is here:
There are some docs up on the GitHub site, but in brief it gives you:
* A Declarative Serializer/Field API that mirrors the Form/Field API.
* A Serializer class which can deal with arbitrary python objects.
* A ModelSerializer class which can handle model instances and query sets.
* A DumpDataSerializer class which mimics the existing dumpdata behaviour.
* Supports flat or nested ouput, and deals with recursive structures.
* Handles FK, M2M, OneToOne, and reverse relationships, model fields, and
* Serialization structure decoupled from output encoding concerns.
* Currently supports JSON, YAML, and XML.
* Decent test suite of the above.
It's not yet at the point where it could be a proposal for core - Right now
API isn't backwards compatible with the existing serializers, the dump
data serializer is still missing some tweaks such as dealing with natural
and there's some work to do on the XML output. It is a pretty comprehensive
start though, and I'm really happy with the shape of the API.
Given that Piotr's GSoC proposal has now been accepted, I'm wondering what
right way forward is? I'd like to continue to push forward with this, but
also aware that it might be a bit of an issue if there's already an ongoing
GSoC project along the same lines?
Having taken a good look through the GSoC proposal, it looks good, and there
seems to be a fair bit of overlap, so hopefully he'll find what I've done
useful, and I'm sure I'll have plenty of comments on his project as it
I'd consider suggesting a collaborative approach, but the rules of the GSoC
wouldn't allow that right?