Re: [Zope3-Users] Seeking Reference Guide on TAL/TALES/METAL

2006-04-06 Thread Stephan Richter
On Friday 31 March 2006 08:49, Jeff Rush wrote:
 whereas I'm trying to get:

      X.__getattr__('Y')    # X.Y

You can use: X/++attribute++Y. A list of all those traversal namespaces are in

Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
Zope3-users mailing list

Re: [Zope3-Users] Seeking Reference Guide on TAL/TALES/METAL

2006-03-31 Thread mats.nordgren
I think the answer to that question is both, but X['Y'] seem to have
precedents over X.Y.

class MyContainer(OOBTree):

class MyContent(Persistent):

Adding MyContent in MyContainer you can traverse MyContainer/MyContent/title
or you can traverse MyContainer/title equally well.  If I name MyContainer
'title' i get MyContent when I try MyContainer/title.



On Fri, 31 Mar 2006 07:49:44 -0600, Jeff Rush wrote
 I've been searching and haven't managed to find the definitive 
 reference guide for the particular dialect of TAL/TALES/METAL that 
 is bundled with Zope 3.  There are various fragmentary and somewhat 
 divergent documents around and little about how the particular TALES 
 namespaces provided by Zope 3 work in complex cases.
 There are no .txt ReST documents under the TAL and TALES source 
 directories, nor anything in the very nice ++APIDOC++ guide.
 My specific question is how evaluation of the path expression X/Z 
 is handled.  It *seems* to be:
  X.__getitem__('Y')# X['Y']
 whereas I'm trying to get:
  X.__getattr__('Y')# X.Y
 Under Zope 2, as I recall, it would try several algorithms; 
 attribute, mapping, sequence.  And I'm wondering if that mechanism 
 was simplified for Zope 3, and in what way.
 Zope3-users mailing list

Zope3-users mailing list