can you explain better what's going on ? the generic json view (as any 
other view) is made to serialize a python object to something (in json's 
case, a json string). 
If you already return a string because your code encodes it already, than 
you don't need any view, because the job the view usually does has been 
done already by your code.

On Monday, July 29, 2013 11:07:35 PM UTC+2, Matt wrote:
>
> Hi,
> We're running into an issue with our restful api where a certain method is 
> returning a json string (eg: " ['one', 'two', 'three'] "), however web2py 
> wants to render this as a string even when the request.extension is forced 
> to json, and the response.view is forced to generic.json. I've tracked the 
> issue down to gluon/main.py:231 where it checks if "page" is a dict, and 
> what seems to be happening is that the valid json string above is instead 
> being concatenated as a string representation. Adding this below the check 
> for dict seems to fix it, but I'm not sure how well it fixes the problem:
>
>     elif isinstance(page, list):
>         response._vars = page
>         run_view_in(response._view_environment)
>         page = response.body.getvalue()
>
> Any suggestions for other ways to go about fixing this? 
>
> Thanks,
> Matt
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to