Does anyone know how to do this?
locals does not seem to be accessible from within the template.
$def with(row)
$# do something so that we can access first_name
$# like this $first_name and not have to do it like
$# this row['first_name']
Here is my var: $first_name
It would especially be useful for when we need to pass the full row of
a db result to a template and not have to declare every single field
with default values. We could also pass the dict that contains the row
of results but in this case each variable has to be preprended by the
dictionary name.
For example
$def with(row):
$row.first_field
I'd prefer to just have to write this $first_field in my template.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---