Not quite right, but as this is not a problem now, just I would like to digg deeper... :)
Let's wait for some experts of Templator... On Nov 5, 5:39 am, jlist9 <[email protected]> wrote: > I'm glad to see that code works now in templator. Last time when I > tried it hadn't been implemented yet. I wonder what are the limitations > for code in templates? Can I import other modules? > > Regarding "$", I think if it's at the beginning of a line, you won't > have to use $ in that line any more. The whole line is a Python line. > > On Wed, Nov 4, 2009 at 1:55 AM, 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? > > > Could anyone please explain the problem presented here? > > > Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
