On Sat, Feb 11, 2012 at 10:30 PM, Rob Peters <[email protected]> wrote:
> I know I should be using the JSON-RPC with Django, and I may in time, but I > have a rather complex model hierarchy that I've never been able to > successfully and reliably serialize with the django serializer. i got round this by creating code that _does_ reliably serialise the data with the django serialiser. particularly, date formats. i did a recursive-walk on the object data calling django's serialiser *only* on the leaf-nodes. it's in the gnumed source code base and you may find a couple of other places, probably in the django formprocessor. there are distinct advantages to sticking with the existing infrastructure. take a look at the dynamictables example, paying particular attention to the classes named "Student", "Person" and "Professor", esp server-side notice the use of the "__jsonclass__" code (in the php, whoops). l.

