On Oct 13, 2006, at 9:02 AM, Ian Bicking wrote:
> class MyController(BaseController):
> def index(self):
> # ... auth stuff, or whatever...
> wsgi_app = FileApp('/path/to/file')
> return wsgi_app(req.environ, req.start_response)
In the current Pylons, it'd be:
return wsgi_app(request.environ, self.start_response)
> Should req have a method like req.delegate(any_wsgi_app)? Also,
> perhaps
> it would look for a .wsgi_application argument, so you could do:
>
> exc = httpexceptions.HTTPRedirect(headers=[('location', loc)])
> return req.delegate(exc)
I'm inclined to think it should have a delegate method or some easy
way to call a WSGI app like that. Not sure it should be on request
though as request is more of a representation of the request than a
place to handle responses. I think it might be useful if the
inspect_call function that calls an action was capable of passing in
environ and start_response you could just do:
def index(self, environ, start_response):
# .. auth stuff...
wsgi_app = FileApp('/path/to/file')
return wsgi_app(environ, start_response)
This way it'd have a very clean call through without any objects
hidden all over.
Cheers,
Ben
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---