<tal:block tal:repeat="image project/images">
<div
tal:define="onlyone python:if repeat.image.length==1: return 'onlyone'"
tal:attributes="class python:'image-{}'.format(repeat.image.number)">
<img
tal:define="img image/getObject"
tal:replace="structure img/@@images/image/custom_1280"
/>
</div>
</tal:block>
У меня уже есть класс, который печатает изображение-N на основе индекса цикла, но как мне добавить еще один класс, если длина равна 1? Документация НЕ понятна https://zope.readthedocs.io/en/latest/zopebook/AppendixC.html#tales-python-expressions, там сказано, что можно использовать любое допустимое выражение Python, но синтаксис всегда неверен для меня.