Tal condition always evaluates to false

Posted by Ander2 on Stack Overflow See other posts from Stack Overflow or by Ander2
Published on 2012-06-19T21:13:59Z Indexed on 2012/06/19 21:16 UTC
Read the original article Hit count: 309

Filed under:
|

I'm using plone and trying to display a form result in a page template.

I'm trying to filter some database results using tal:condition with a python expression but it always evaluates to false.

The code looks like this:

 <tr tal:repeat="result view/results">
     <td> <span tal:condition="python:view.teams[0]==result.team_id" tal:replace="result/position">Position</span></td>
     <td> <span tal:condition="python:view.teams[1]==result.team_id" tal:replace="result/position">Position</span></td>
</tr>

I want the table cells to be filled with the team position when the team id is matched in the result, but the cells always are empty. If I remove the tal:condition from the span and replace the tal:replace="result/position" with tal:replace=python:view.teams[0]==result.team_id it prints True or False so I can check that the result is correct.

Can anyone help me about this issue? Why does tal:condition allways evaluate false?

© Stack Overflow or respective owner

Related posts about plone

Related posts about zope