I am trying to apply a standard representation to the fields in a
SQLFORM.grid object using their field names with the following code:
for f in db.things.fields:
db.things[f].represent = lambda value, row: DIV(value if value else
'-',_class=f, _id=str(row.id)+ '.' + f)
but all of the fields wind up with the exact same representation:
<tr class="odd with_id" id="6">
<td>
*<div class="modified_by" id="6.modified_by">*6</div>
</td>
<td>
*<div class="modified_by" id="6.modified_by">*Years--but in other pigments
compounded so it tells us at on</div>
</td>
<td>
*<div class="modified_by" id="6.modified_by">*2008-08-02</div> . . .
Incidentally, the "modified_by" field is the last field in the table. Does
anyone see what I am doing wrong here and how I can correct it?
Thanks,
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.