there are multiple errors (and lots of unnecessary parenthesis).
first of all, define a single function to represent your value
def represent_colored(value):
if value == 1:
return .. <--green
elif value == 2:
yellow
elif value == 3:
Thanks for the reply, Niphlod.
Now there was the following question:
I add the following lines to the controller before the grid = SQLFORM.grid
...
warn = db.executesql ('SELECT t.level_warn FROM TEMPER_RC t;')
for val in warn:
if (val == (1)):
db.TEMPER_RC.level_warn.represent
grid uses represent if available.
http://web2py.com/books/default/chapter/29/06?search=represent#Record-representation
On Thursday, June 6, 2013 2:46:47 PM UTC+2, keep...@gmail.com wrote:
>
> Hello everyone.
>
> I'm new to web2py and I have a question about customizing fields in
> SQLform.grid.
3 matches
Mail list logo