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