14 messages in com.googlegroups.pylons-discussRe: Response
FromSent OnAttachments
Philip Jenvey21 Jun 2006 13:21 
Jose Galvez21 Jun 2006 13:24 
Jose Galvez21 Jun 2006 13:28 
ToddG21 Jun 2006 14:31 
jose22 Jun 2006 10:13 
Ian Bicking22 Jun 2006 10:22 
Ben Bangert22 Jun 2006 10:26 
Ian Bicking22 Jun 2006 13:45 
Ben Bangert22 Jun 2006 14:05 
Ben Bangert22 Jun 2006 14:30 
Jose Galvez22 Jun 2006 14:40 
Ben Bangert22 Jun 2006 15:44 
ToddG22 Jun 2006 17:16 
ToddG22 Jun 2006 17:26 
Subject:Re: Response
From:Jose Galvez (jj.g@gmail.com)
Date:06/22/2006 02:40:35 PM
List:com.googlegroups.pylons-discuss

I think text_response would be worse then just going back to Response. Rather then creating a new way to send output the the browser (text_response) why not just creat two alias for WSCGIResponse? Response and response, then either could be used. Jose

On 6/22/06, Ben Bangert <be@groovie.org> wrote:

On Jun 22, 2006, at 10:22 AM, Ian Bicking wrote:

Of course, the *real* problem is that request is an instance, and if you want a response you do:

response = WSGIResponse(...)

That is, WSGIResponse (or Response or whatever) isn't a response, it's a response factory. So on further thought I'm not sure it's such a good idea to confuse the response and the response factory, since the symmetry with request isn't actually there false.

I'm inclined to agree, though I definitely saw Todd and Jose's problem with Response() when they were chugging along so nicely with the other render statements. Which has me tempted to go back to just having Response(), or perhaps taking Todd's function and having a function like: return text_response("Hello World")

That will create and return a Response with that text. If someone still wants a response object to fiddle with: resp = Response() resp.content_type = "something/else" return resp

Which keeps a clear distinction between the fact that request is an instance and Response creates response instances while still providing a obvious way to create and return a 'plain' text response.