hey all,

so in building my first repoze.bfg app, it's occurred to me that i'd like to 
use a custom Request and Response classes, just simple subclasses of the WebOb 
defaults so that i can set configurable class variables like default_charset. 
unless i'm missing something in the code, there's currently no support for this.

how would folks feel about the following changes:

- in repoze.bfg.router, the paster config would be checked for "request_class" 
setting, which would be a dotted path to a request class to use.  absence of 
this setting means use the default class, nothing changes.

- every place that a response object is currently instantiated, use 
request.ResponseClass instead of explicitly using the WebOb class.

AFAICT, response objects are instantiated in the following repoze.bfg modules:

- chameleon_[genshi|text|zpt]
- view
- wsgi
- xslt

in the 'view' and 'wsgi' modules, we're already holding the request object 
when the response is instantiated, so there's very little to change.  in all 
of the other modules, the response is being instantiated in a 
render_[template|transform]_to_response function.

the biggest change, then, would be to have all of the render-to-response 
methods start requiring request objects as arguments.  this could be optional 
at first, w/ a deprecation warning if it's left out, until such time as we 
might see fit to force the issue.



Repoze-dev mailing list

Reply via email to