我试着检查date控件是否为空。如果它是空的,它就不应该出现。
<div class="field"
tal:define="value widget/value;
valueexists python:value not in (None, '',);
label widget/label"
tal:condition="python:widget.__name__ not in ('IBasic.title', 'IBasic.description', 'title', 'description',) and valueexists">
问题是下面的表达式似乎无法检查日期:
python:value not in (None, '',)
发布于 2011-05-17 00:02:17
为什么不像这样:
<div class="field"
tal:define="value widget/value;
label widget/label"
tal:condition="python:widget.__name__ not in ('IBasic.title', 'IBasic.description',
'title', 'description',) and value">
...
</div>
测试widget/value的特定值似乎注定会带来麻烦。
发布于 2011-05-17 15:58:22
我不确定我是否正确理解了你的问题,但我也想建议jQuery作为一种检查和有条件地隐藏(删除)小部件的方法,如果它是出于美学原因的话。
https://stackoverflow.com/questions/5997605
复制相似问题