On Wed, Nov 4, 2009 at 3:25 PM, xrfang <[email protected]> wrote:
>
> I have the following template (part):
>
> $code:
>   def status(c):
>       st = {}
>       st[0] = 'Not Started Yet'
>       st[1] = 'In Progress'
>       st[2] = 'Finished'
>       return st[c]
>
> $for t in todos:
>   <tr class="$loop.parity"><td><input
> type="checkbox"></td><td>$t.summary</td><td>$status(t.status)</td><td>
> $t.name
>
> </td><td>$t.timestamp</td></tr>
>
> The question is, in the function call $status(), if I call
> $status(t.status), as above, it works, but if I do:
> $status($t.status), it does NOT!   My original understanding is $ is
> used to "dereference" the template variable, i.e. use its value?

with $status(..) you have entered into Python domain. The templete
tries to intrepret $t.status as python code, which is invalid.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to