The web2py would use generic views depending of extension of url.
Is it?

Em terça-feira, 28 de junho de 2016 11:31:48 UTC-3, Joel Samuelsson 
escreveu:
>
> Hi,
>
> I'd like to respond with a complex data structure when raising a HTTP 409 
> Conflict as response to a restful request but I can't seem to figure out 
> how. If possible, I'd like to reuse as much as possible from built-in 
> functions in web2py. The best idea I've gotten so far is something like 
> this:
>
> @auth.requires_login()
> @request.restful()
> def test():
> response.view = 'generic.'+request.extension
>
> def GET(*args,**vars):
> page = response.render('generic.'+request.extension, 
> dict(errors=["error1", "error2"]))
> raise HTTP(409, page)
>
> return locals()
>
>
> However, this does not set the appropiate Content-Type. Are there 
> easier/better ways to do what I want?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to