[Zope-dev] zope.globalrequest?

Laurence Rowe l at lrowe.co.uk
Sun Jan 18 10:43:23 EST 2009


Roger Ineichen wrote:

> just a sample;
> In my point of view an application like a wiki or forum etc.
> should get developed as a python application without to require
> a global request because it's just a (MVC) model part. There should
> never be a request involved. If such a wiki needs a "last modified user"
> argument. This should not get set by a global request lookup.
> Or at least not the model should use such a global request by itself.
> If you need to set such a "last user modified" argument the view/controller
> should be responsible for doing so. I'm pretty sure if we have a global
> request available we will see very quick that developer start to use
> the global request in the model part.
> 
> Note, mixin model, view and controller responisibilities into one 
> component/object make it allmost impossible to replace or reuse
> parts of it.

The most convincing reason for me to persevere with the current pattern 
of views is that it offers the possibility of adaption on the request. 
This is something that repoze.bfg is exploring and I think could be 
helpful, for instance registering separate views on POSTRequest from 
GETRequest.

I don't see anything wrong in allowing a utility access to the request 
without explicitly including it in its method signature. If they choose 
to use it from a model, it's their foot and they are free to shoot it if 
they wish.

Laurence



More information about the Zope-Dev mailing list