On Thu, Dec 01, 2005 at 07:40:38AM +0000, Chris Withers wrote:
> Jonathan Cyr wrote:
> >You might want to use index_html rather than index.html in this
> >example. The dot means other things in Python, and index.html is a
> >carryover from filesystem webservers. My impression is that the
> >acquisition mechanism doesn't like ids with a dot, in some circumstances.
> Acquisition works fine irrespective of the object id.
> And dotted or dashed names work fine in ZPT path:
> If you use python, most objectmanagers support dictionary-like notation:
> ...and if you object doesn't support dictionary-like notation, you can
> use getattr:
> And getattr performs Acquisition just fine...
... but __getitem__ doesn't :-)
So here['my-folder']['index.html'] is semantically different
from getattr(getattr(here, 'my-folder'), 'index.html').
The former works strictly by local containment and does
not use acquisition. The latter may use acquisition.
I know Chris knows this, but maybe other people following
p.s. "here" should be deprecated, use "context" instead.
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists -