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? If so, I don't understand. My response contains a string (which happens to be a JSON object, regardless of how it was produced). My pyjamas client does not seem to be able to access, despite it showing up in Firebug as the response. I've pasted my "network interface" code here: http://pastebin.com/ghbA91gQ My response (as copied and pasted from Firebug's "Response" tab) is: {"models": [{"information": "", "name": "WLS", "parent": null, "created": "2012-02-08 15:26:04", "deleted": false, "editable": true, "modified": "2012-02-08 15:26:02", "model_type": "Client", "pk": 1}], "event": "models_loaded_event"} Any and all suggestions are appreciated. Kind regards, Robert

