> > I haven't been able to figure this out: I want to use the "format" > representation defined in my db model to represent the rows in a list of > query results. In other words, I'd like to be able to do something like > this: > > rowlist = [] > q = db(db.mytable.id > 0).select() > for r in q: > rowlist.append(r._format) > > But, of course, r._format doesn't give me the formatted representation of > the row. (It seems to be a property of the db.tables[x] object, but not not > a property of the rows object produced by the query.) >
You can always access the db.table._format attribute directly and pass a row to it (exactly how depends on whether it is a string or a lambda), but what exactly are you trying to do? The format attribute is used to format a single reference field from another table, but in your code above, it looks like you want to transform entire rows and append them to a list of rows. Can you show your models and exactly what you are trying to achieve? Anthony

