[Zope] __getitem__ and returning a PageTemplateFile instance

Dieter Maurer dieter at handshake.de
Fri Oct 21 13:49:17 EDT 2005


Anders Bruun Olsen wrote at 2005-10-21 15:06 +0200:
> ...
>Ahh.. that makes sense I guess. It just seems counterintuitive that you
>can return a string in a normal function, but not in __getitem__.

Can can return a string from "__getitem__" (without problem),
*but* you cannot use this string during URL traversal.

By the way, it does not matter for URL traversal whether the string (or
other simple type object or object without docstring) was
returned by "__getitem__", "getattr" or "__bobo_traverse__"
(these are the possibilities to obtain the subobject during URL
traversal) -- the publisher will in all cases reject it.


-- 
Dieter


More information about the Zope mailing list