On Thu, 2009-12-17 at 18:10 +0100, Jens Hoffrichter wrote:
> > import simplejson
> > json_obj = {'foo', 'bar'}
> > return simplejson.dumps(json_obj)
> > etc...
> 
> Or even simpler (at least in 0.9.6.2 - not sure if this still stands
> with newer versions)
> 
> from pylons.decoraters import jsonify
> 
> class TestController(BaseController):
>   @jsonify
>   def testaction(self):
>     return {'foo','bar':4711}

Do we need to  build the dict ourselves?

Or is there a method where in a certain return value is wrapped in a
javascript object and rendered?

happy hacking.
Krishnakant.


--

You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.


Reply via email to