[Grok-dev] megrok.traject

Martijn Faassen faassen at startifact.com
Thu Dec 3 10:23:50 EST 2009


Christian Klinger wrote:
> Am 03.12.09 13:08, schrieb Martijn Faassen:
[snip]
> i can not access the index View for User without the grok.Model
> Mixin.
> 
> I think this is because the User object has no ILocation settings...

Ah, true. That has nothing to do with traject directly. It has something 
to do with defaultView.

The problem is that defaultView is not registered as 'index' for the 
object. This means it defaults to 'index.html'.

Grok sets the default view to 'index' for IContext, and that's defined 
by grokcore.component. grokcore.component.Context implements that 
interface, so would therefore do as a mixin, but grok.Model inherits 
from that as well.

It's a bit of a pitfall I actually ran into myself a while ago.

Perhaps in a future version of Grok we should set 'index' be the default 
view for *all* objects, not just Context. That would break the 
assumptions of traditional Zope 3 apps though.

Regards,

Martijn



More information about the Grok-dev mailing list