Gael Pasgrimaud wrote:

> _py_object is not defined at this this. __init__ is a special case.
> You can only use @jsonify on a controller action.
> 
> Try:
> 
> class JsonController(BaseController):
> 
>     @jsonify
>     def data(self):
>         return {'test':'values'}
> 

It still doesn't work:


from helloworld.lib.base import BaseController

import pylons.decorators

class JsonIt(BaseController):

     @pylons.decorators.jsonify
     def data(self):
         return {'abc':123}


I call it like that in controller:

     def jsontest3(self):
         return helloworld.lib.projlib.JsonIt().data()


Again, the error msg is "AttributeError: 'JsonIt' object has no 
attribute '_py_object'"

Regards,
mk


--~--~---------~--~----~------------~-------~--~----~
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