You can't do it automatically, but you can always access the represent 
function for a field if needed. For example:

db.foo.bar.represent(stuff[0].bar)

will apply the represent function to stuff[0].bar.

In this case, there is also a DAL function for upper() which can be used in 
selects:

upperbar = db.foo.bar.upper()
stuff = db().select(upperbar)
stuff[0][upperbar]

Anthony

On Tuesday, October 25, 2011 5:04:39 AM UTC-4, jon wrote:
>
> Looking for ideas on how to get the result of a field's repr instead 
> of its raw value when doing a select.  Example: 
>
> db.define_table('foo', Field('bar', represent=lambda x, row: 
> x.upper())) 
> db.foo.insert({'bar':'aaa'}) 
>
> then in my controller... 
>
> stuff = db().select(db.foo.ALL) 
>
> The value of stuff[0].bar is 'aaa' but I want 'AAA' (the output of the 
> field's "represent" function).

Reply via email to