[Zope] RE: tal:repeat usage

Clemens Robbenhaar zope@zope.org
Tue, 5 Nov 2002 21:02:12 +0100


Andrew:
 > 
 > Evan:
 > 
 > This, unfortunately, does not work.  It yields the error "global name 'a' is
 > not defined"
 > 
 > The issue is that dictionary keys do not seem to be traversible as
 > attributes.  So what I need to be creating in the tal:define is a dictionary
 > that has a __getattr__ function I guess??
 > 

... or simpler use  tal:repeat="python:v['a']" 

 In my opinion python expressions would make better defaults than path
expressions anyway, as one does not run into the limitations of path
expressons every now and then. (This is not a serious proposal, of
course; I just do not like one line replies ;-)


Cheers,
Clemens

 > A.
 > 
 > -----Original Message-----
 > From: Evan Simpson [mailto:evan@4-am.com]
 > Sent: Tuesday, November 05, 2002 2:19 PM
 > To: Andrew Athan; zope@zope.org
 > Subject: Re: tal:repeat usage
 > 
 > 
 > Andrew Athan wrote:
 > > <span tal:define="global foo python:[{'a':1},{'a':2}]"></span>
 > >
 > > <span tal:repeat="v foo">
 > >   <span tal:content="repeat/v/a"></span>
 > > </span>
 > 
 > Use "v/a" instead of "repeat/v/a".
 > 
 > Cheers,
 > 
 > Evan @ 4-am
 > 
 > 
 > 
 > 
 > 
 > _______________________________________________
 > 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 )