No problem. For this interested, in trunk, you can now do:
rows = db(query).select()
repr_row = rows.repr(0)
The .repr() method of the Rows object takes an index and returns a copy of
the indexed row, but for fields with "represent" attributes, the
"represent" function is applied to the value i
:D
Looks good! I'll have to check out trunk and try it out.
Thanks for the answers (makes me feel like I'm getting pretty good with
web2py) and especially for the code!
-C
On Thursday, 20 June 2013 22:08:27 UTC-5, Anthony wrote:
>
> FYI, see possible solution here:
> https://groups.google.co
FYI, see possible solution
here: https://groups.google.com/d/msg/web2py-developers/kMMG1wH6Xxg/pCYZfJGHVckJ
Anthony
On Thursday, June 20, 2013 8:22:54 PM UTC-4, Anthony wrote:
>
>
> Not a bad idea. Maybe have a look at how SQLTABLE and SQLFORM.grid (both
>> in gluon.sqlhtml.py) handle field rep
> 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')
>
Actually, Row objects don't know about their db/table, so
> 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.
5 matches
Mail list logo