[Grok-dev] Re: grok.layer branch

Martijn Faassen faassen at startifact.com
Tue Apr 17 13:59:40 EDT 2007

Philipp von Weitershausen wrote:
> Leonardo Rochael Almeida wrote:

>> IMHO, the intent of grok.context(SomeClassOrInterface) is clear
>> enough. grok.request(SomeLayer) doesn't seem that clear, at least not
>> for me...
> It sets a constraint on the view's "request" attribute. That's what 
> grok.context() does.

It's true grok.request() indicates what kind of requests we want to 
handle, as layers are interfaces provided by the request.

I think it's also true it isn't immediately clear that this is what 
grok.request does. Do we anticipate other purposes of using this
directive besides setting the type of layer?

Then again, grok.context refers to things that are grok.Model 
subclasses, and it's not immediately clear context refers to that 
either. So we do have a preference for this pattern.

>> I'd suggest grok.for_layer() or grok.at_layer()
> -1
> Let's avoid underscores where we can.




More information about the Grok-dev mailing list