[Zope] Problems calling directory

Tino Wildenhain tino@wildenhain.de
Fri, 20 Apr 2001 08:44:41 +0200


Hi,

this is a common understanding problem. To get a feeling
whats bad, try to start the python interpreter
and type in the following:

class dummy:
	def __getitem__(self,key):
		return(getattr(self,key))
# two newlines here	

a=dummy()
b=dummy()
c=dummy()

b.c=c
a.b=b

you now can access c thru a and b like this:

a.b.c

or a['b']['c']

but you cannot use a['b.c'] to access c, since
the objects names are 'b' and 'c' and not 'b.c'

HTH
Tino Wildenhain

--On Donnerstag, 19. April 2001 17:39 -0700 Adrian Madrid 
<aemadrid@yahoo.com> wrote:

> I have a zclass which defines articles with a
> 'location' field. (ie. location =
> 'Portal.Publications.Review'). My problem is that the
> articles are located in a certain area but need to
> show in the 'location' specified. I don't understand
> why this code works:
>
> <dtml-with "Portal.Publications.Review">
>   <p>This is the <dtml-var document_id> Document
>      in the <dtml-var title_and_id> Folder.</p>
> </dtml-with>
>
> While this code does not work:
>
> <dtml-with "_['location']">
>   <p>This is the <dtml-var document_id> Document
>      in the <dtml-var title_and_id> Folder.</p>
> </dtml-with>
>
> Any ideas?
>
>
>
> =====
> ---------------------------
> Adrian Esteban Madrid
> Benson Institute, Webmaster
> Brigham Young University
> ---------------------------
> adrian_esteban@madrid.com
> ===========================
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )