[Grok-dev] Traversing

Philipp von Weitershausen philipp at weitershausen.de
Thu Oct 19 17:30:55 EDT 2006


Christian Theune wrote:
> I just noticed that our traverser does not know what to do if traverse()
> isn't defined.

What do you mean?

> I stumbled over that when I switched our wiki to grok.Container. I
> talked to Philipp shortly on IRC and he proposed not to do fallback to
> attribute/dict access.

It should obviously use the getitem protocol for containers. But I 
really don't think we want to support traversing to arbitrary attributes 
or keys like in Zope 2. It makes stuff accessible via URLs that 
shouldn't be accessible.

> I somewhat agree. However, we have to define how grok.Container behaves.

Yes. I agree that that is currently fishy.

> The most simple solution I can imagine would be to define a default
> traverse() on the container that does the dict lookup.

That's a good solution.

Philipp


More information about the Grok-dev mailing list