Pass index in a TAL path expr
Hello, if "data" is a tuple (or list), how can directly access it's contents using path expressions, like in: -- script "s": return context.t(data=("one", "two", "three")) -- template "t" <html><body> <span tal:replace="options/data/0"></span> </body></html> The above example give out a TypeError for the index... "options/data/0" is not correct. What should i set the path to?
--On Mittwoch, 20. April 2005 13:14 Uhr +0300 Vangelis Mihalopoulos <mihalop@vtrip.net> wrote:
Hello,
if "data" is a tuple (or list), how can directly access it's contents using path expressions, like in:
-- script "s": return context.t(data=("one", "two", "three"))
-- template "t" <html><body> <span tal:replace="options/data/0"></span> </body></html>
The above example give out a TypeError for the index... "options/data/0" is not correct. What should i set the path to?
You have to use python: data[0]. Your notation is not supported. -aj
participants (2)
-
Andreas Jung -
Vangelis Mihalopoulos