On Wed, Jul 27, 2016 at 6:08 PM, Uwe <[email protected]> wrote:

> Alessandro, I should have mentioned that I did try that config setting.
> But guess what:
>
> The response has to be a dict or a string or you see other errors pop up
> because code down the chain expects a dict.
>
Ah yeah, sorry, I through you were blocked on the JSON encoder.
Yes, by design TurboGears actions can only return strings or dicts, in all
cases.

What you want to achieve can be done by returning the result of
tg.json_encode:

@expose('json')
def action(self):
   return tg.json_encode([1,2,3])

That will use the turbogears json encoder to create the json and if you
provided the json.allow_lists = True option it will properly send the
encoded array.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to