Tag: zope

如何用TAL创build斑马条纹CSS?

我如何使用变色龙或Zope页面模板轻松创buildCSS斑马条纹? 我想为表中的每一行添加odd和even类,但是使用repeat/name/odd或repeat/name/even的条件,即使使用条件expression式, repeat/name/even看起来比较冗长: <table> <tr tal:repeat="row rows" tal:attributes="class python:repeat['row'].odd and 'odd' or 'even'"> <td tal:repeat="col row" tal:content="col">column text text</td> </tr> </table> 如果你有多个类来计算,这会变得特别乏味。

ZCML在five.grok中allowed_attributes对应的方法

有没有办法标记grok.CodeView类中可遍历的方法,就像你可以用Zope 3 BrowserView和allowed_attributesconfigurationZCML指令一样? 我find了关于grok.traversable()文档,但是看起来这样的方法在五个grok包中不存在。