I've found a solution:
rows = db(db[table].id == id).select()
rendered_row = rows.render(0, fields=[db[table][column]])
value = rendered_row[column]
On Saturday, April 21, 2018 at 12:31:49 PM UTC+2, xelomac wrote:
>
> Thank you Anthony. Works perfectly in a SQLFORM.grid. The values get
> display
Thank you Anthony. Works perfectly in a SQLFORM.grid. The values get
displayed as expected.
But outside of the grid for something like this
persons = db(db[table].id == 1).select()
person=persons[0][column]
the stored values get displayed not its representation. How can I get the
representati
The validator controls the widget used in forms but no the format in the
grid -- for the latter, use the "represent" attribute:
represent=lambda v, r: GENDER[v]
Anthony
On Sunday, April 15, 2018 at 4:47:27 AM UTC-4, xelomac wrote:
>
> Consider the following example.
>
> Model:
>
> GENDER = {"ma
3 matches
Mail list logo