Richard Jones wrote:
During the Melbourne Zope3 Sprint, someone ran up against a situation where they'd have liked to have TALES perform a tuple unpacking like Python can. I've just run into a similar situation :)

Say a method listFilesByUser returns a list of (user, [files]) it'd be nice to be able to::

tal:repeat="user,files here/listFilesByUser"

or similar. Currently we would have to use a python: expression to manually unpack the tuple. Kinda yucky.

I agree that it is 'yucky', but I have to disagree with your proposed solution. I would rather suggest making TALES aware of integer indexes for sequences. Example::

  <tal:block repeat="user_files here/listFilesByUser">
    User: <tal:dummy replace="user_files/0" />
    File: <tal:dummy replace="user_files/1" />



Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists - )

Reply via email to