The same way I do deletion with this function you can add stuff or replace
stuff base on a if case on your differents text states... Not the best
approach I think, but you can...
def __del_sqltable_column(sqltable, column_name):
"""
For deleting a given column in an instance of web2py SQLTABLE class.
Pass the SQLTABLE object and the column name to delete.
Ex.: table1 = SQLTABLE(rows) contains id column and we want to delete
it.
So we call __del_sqltable_column(tabel1, 'table.id') or
__del_sqltable_column(request.args(0), db[request.args(0)].id)
When the column name is changed with represent the representation should
be
passed as column name.
"""
import re
regex_colum_name = re.compile(str(TH(column_name)))
for i in range(0, len(sqltable[0][0])):
if regex_colum_name.match(str(sqltable[0][0][i])):
for r in range(0, len(sqltable[1])):
del(sqltable[1][r][i])
del(sqltable[0][0][i])
return sqltable
return sqltable
Hope it helps.
Richard
On Tue, Aug 16, 2011 at 12:23 PM, Valter Foresto
<[email protected]>wrote:
> I'm using SQLTABLE() into a controller to generate a table for the next
> view.
>
> A column of the table report only few states (text) that can might be
> better represented using small, 16x16 or 32x32, images.
> It is possible to insert icons, instead of text, into a table column and
> then pass the result to the viewer ?
>
> Thanks in advance for suggestions.
> Valter
>