[ZPT] repeat trick

Phil Harris phil.harris@zope.co.uk
Tue, 10 Jul 2001 15:46:01 +0100


untested;

tal:define="users here/getUsers | python:[]"

, maybe?

----- Original Message ----- 
From: "Peter Bengtsson" <mail@peterbe.com>
To: <zpt@zope.org>
Sent: Tuesday, July 10, 2001 3:32 PM
Subject: [ZPT] repeat trick


> Please have a look at
> http://www.zope.org/Members/peterbe/DTML2ZPT/#example13
> 
> This is the code I'm having problems with::
> 
>  <textarea name="users:list"
>     tal:define="users here/getUsers | nothing; string modules/string"
>     tal:content="python:string.join(users,'\n')"></textarea>
> 
> First is defines what 'users' is by that function, and if not found, it's
> defined as 'nothing'.
> This is wrong because 'nothing' can't be looped over.
> What I theoretically wanted to do was this:
> 
>   tal:define="users here/getUsers | []"
> 
> but that's not permitted.
> 
> How to do?
> 
> Cheers, Peter
> 
> 
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://lists.zope.org/mailman/listinfo/zpt