[Grok-dev] megrok.traject
Christian Klinger
cklinger at novareto.de
Thu Dec 3 10:29:02 EST 2009
Hi Martijn,
thanks for this explanation. This makes things now cleaner for me....
Christian
> 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