Hi,
Google Sumer of Code is almost ended. I was working on customizable
serialization. This project was a lot harder than I expected, and sadly
in my opinion I failed to do it right. I want to apologize for that and
especially for my poor communication with this group and my mentor. I
want to improve it after midterm evaluation but it was only worse.
I don't think my project is all wrong but there is a lot things that are
different from how I planned. How it looks like (I wrote more in
documentation)
There is Serializer class that is made of two classes: NativeSerializer
and FormatSerializer.
NativeSerializer is for serialization and deserialization python objects
from/to native python datatypes
FormatSerializer is for serialization and deserialization python native
datatypes to/from some format (xml, json, yaml)
I want NativeSerializer to be fully independent from FormatSerializer
(and vice versa) but this isn't possible. Either NativeSerializer must
return some additional data or FormatSerializer must give
NativeSerializer some context. For exemple in xml all python native
datatypes must be serialized to string before serializing to xml. Some
custom model fields can have more sophisticated way to serialize to
sting than unicode() so `field.value_to_string` must be called and
`field` are only accessible in NativeSerializer object. So either
NativeSerializer will return also `field` or FormatSerializer will
inform NativeSerializer that it handles only text data.
Backward compatible dumpdata is almost working. Only few tests are not
passed, but I am not sure why.
Nested serialization of fk and m2m related fields which was main
functionality of this project is working but not well tested. There are
some issues especially with xml. I must write new xml format because old
wont work with nested serialization.
I didn't do any performance tests. Running full test suite take 40
seconds more with my serialization (about 1500s at all) if I remember
correctly.
I will try to complete this project so it will be at least bug free and
usable. If someone was interested in using nested serialization there is
other great project: https://github.com/tomchristie/django-serializers
Code: https://github.com/grapo/django/tree/soc2012-serialization
Documentation: https://gist.github.com/3085250
--
Piotr Grabowski
--
You received this message because you are subscribed to the Google Groups "Django
developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.