> 1) Am I missing something with the abilities of 'represent' to easily > represent records' field values? >
I think the represent attribute is currently only used in SQLTABLE, SQLFORM.grid (and smartgrid), and in forms (i.e., read-only fields), so no, I don't think you're missing anything. > 2) is there a way, given a *row* object, to very easily (e.g. not writing > supporting code beyond lambda statements) represent the field value without > explicitly calling the db.table.field.represent() function on the field > value? Don't think so, but you should be able to do db.mytable.myfield.represent(row.myfield, row). > 3) would it be feasible and recommended to create a simple class that > takes Rows objects and creates a DIV-based representation? How might I go > about doing this if so? Not a bad idea. Maybe have a look at how SQLTABLE and SQLFORM.grid (both in gluon.sqlhtml.py) handle field representation. Very simply, we might add a method to the Row class allowing something like: row.represent('myfield') and maybe row.represent(), with no arguments, could return a copy of the row object with all the fields transformed based on their "represent" attribute. This approach wouldn't involve any HTML, so you would be free to use the values however, without being constrained by some fixed HTML structure. Anthony -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.