I have an SQLFORM.grid(... orderby=db.host.id ...) where db.host.id.represent=lambda value, row: int( db((db.url_queue.host_id == value) & (db.url_queue.removed == None)).count() )
The host.id column displays the correct numbers, but when I click on the column title to order ascending or descending, the order is seemingly random. I suspect it's ordering not by the lambda value, but rather by the underlying host.id value. Seems like a bug ...? --