Rob Miller wrote:
> i'm not really following you here.  i'm -1 on the idea of an
> IResponseFactory utility.  i think having the ResponseClass available on
> the request objects meets the need here; the hook is already in WebOb,
> why not just use it?

Because it means changing some very "cooked" APIs  (e.g.
render_template_to_response) because there's no way to get the current request
without passing it in to the functions that would need it; I don't want to
complicate existing APIs and risk breaking apps just to get this functionality.

> if anything, i'd rather see an ICurrentRequest utility, which always
> returned the request object for the current request... or some other way
> to always get at the request object, regardless of whether or not it's
> been explicitly passed in.  if request.ResponseClass is always used when
> instantiating a response object, then there's no need to support any
> other pluggability; the request object serves the need just fine w/o
> requiring another utility.

The two things aren't really incompatible:  if we ever do add a
``get_current_request`` API, you'll be able to use it in the IResponseFactory to
get request.ResponseClass and return it.  But in the meantime, it would appear
to get you what you want (which is just to get a different response class).

And the real reason: I've already implemented it. ;-)

- C
Repoze-dev mailing list

Reply via email to