Tal condition always evaluates to false
- by Ander2
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?