ToddG wrote:
> 'render_response' is in fact a convenience method; I think you'll need
> to use the "long" way to do it; here's the lineup of usual suspects
> (hopefully someone can verify they're all up to date):
>
> http://pylonshq.com/docs/0.9.2/getting_started.html#controller-variables-and-template-globals
>
> "render_response" is....
> - Function to render a template and return a valid Response object.
>
> - Equivalent to Response(render(...))
>
> Response (actually a WSGIResponse) takes a status code in its
> constructor, or you can set the headers after the object is created.
> The [WSGI]Response constructor:
>
> def __init__(self, content='', mimetype=None, code=200):
> [.....]
>
> http://pylonshq.com/docs/0.9.2/paste/wsgiwrappers.py.html?f=132&l=294#132
>
> Hope that helps (and I got it correct...)
> -TG
I had seen the docs for (WSGI)Response and that's where I got the code
keyword arg here:
return render_response('/service/%s.myt' % template, code=code)
Apparently, though (see discussion below), render_response uses
status_code instead of code. So, this works:
return render_response('/service/%s.myt' % template, status_code=code)
A wee bit confusing if you ask me.
--
Wyatt Baldwin
byCycle.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---