Again this thread was started in 2007. I suggest you look into the book
with contains more recent API. I do not know that people use SQLTABLE any
more.
You can do
db.table.field.represent = lambda value: row: value
and you can change the representation of the value any way you want. Most
people use
grid = SQLFORM.grid(db.table)
which can be customized in may ways, does pagination, searching, crud, etc.
On Tuesday, 31 July 2012 11:33:08 UTC-5, Oskari wrote:
>
> This is a great option but what is the best practice then to have the
> represents-functionality still on board? It is a bit messy to do that
> totally on your own
>
> On Friday, 30 November 2007 16:26:12 UTC+1, mdipierro wrote:
>>
>> What you try to do is too much personalization for sqltable. You
>> should not use SQLTABLE. make a view like
>>
>> ---- mytable.html ----
>> {{def mytable(records):}}
>> <table>{{for r in records:}}<tr>{{for k,v in r.items():}}<td>{{=v}}</
>> td>{{pass}}</tr>{{pass}}</table>
>> {{return}}
>> -------------
>>
>> import it in your view with {{include 'mytable.html'}} and use it
>>
>> {{mytable(db(...).select())}}
>>
>> the you can personalize your table as you want and reuse it.
>
>
--