On Mon, Feb 13, 2012 at 7:58 PM, Rob Peters <[email protected]> wrote: > On Sat, Feb 11, 2012 at 4:48 PM, lkcl luke <[email protected]> wrote: >> >> 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. > > > Thanks for the information, Luke. I'll take a look at those classes. > > Are you saying that my inability to access my JSON response is due to how my > information is being serialized?
no, i'm saying that you're making a lot of work for yourself, when deploying the code that has already been written which is suitable precisely and exactly for not only the purpose you describe but also in the *exact* same environment that you describe (django), would do precisely the job that you need and would save you a vast amount of arseing about. thus, given the requirements, and given that there exists a solution, i haven't commented on (and won't, sorry) the debugging that you're doing because it is a non-optimal path. if you choose to stick to the non-optimal path, feel free to explore that space for as long as you find it useful to do so, and, should you find the solution please do let us know. if however you choose to listen to my advice and take the more optimal path, i will go out of my way to make sure that you succeed with it. l.

