An example from my last app:

results = []
for app in apps:
    results.append({"appname" : app.appname})

# for JSONP
callback = this.request.get("callback")

this.response.headers["Content-Type"] = "text/javascript"
callback = "%s(%s)" % (callback, json.write(result))
this.response.out.write(callback)


On Mar 6, 12:28 pm, Devraj Mukherjee <[email protected]> wrote:
> Hi all,
>
> Quick question about converting model objects in JSON. Have done some
> reading and I can't find a way to use simplejson to serialize model
> objects because the data types don't support it.
>
> What is the best way to convert a model to json?
>
> Thanks.
>
> --
> "The secret impresses no-one, the trick you use it for is everything"
> - Alfred Borden (The Prestiege)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to