Is there a way to return json values when a controller function is
called from an http request and return native python values when the
function is called from within another controller function?
Basically, this is what I want to do:
@expose(allow_json=True)
def func1(self, **kwargs):
...
return dict(key1=val1, key2=val2)
def func2(self, **kwargs):
...
result = func1(tg_format='plain', arg1=val1)
So, when func1() is called via an http request (with
tg_format='json'), it will return json, and when it's called from
func2(), it will return a python dictionary.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---