On Thu, 2009-09-03 at 18:15 -0400, Chris McDonough wrote:
> On 9/3/09 3:40 PM, Iain Duncan wrote:
> > Hey folks, I have some stuff in middleware that I need my models in a
> > bfg traversal graph to be able to get at.
> Using request parameters in model code is technically unsupported.    In the 
> bfg 
> "mindset", models need no access to the request environment.  But please 
> check 
> out the "repoze.bfg.threadlocal" module.  (Please read the comment relating 
> to 
> "get_current_request").  Then decide what you want to do.

That's what I thought, which makes sense to me for the bfg way from what
I understand. But then I got stuck at middleware, does it not also seem
reasonable that a model might want to interact with middleware? In this
instance for example, the choice of db url string is made by middleware.
But maybe that needs to be pushed out into get_root.

hmmm. :/


Repoze-dev mailing list

Reply via email to