All pastes #877020 Raw Edit

Untitled

public python v1 · immutable
#877020 ·published 2008-01-29 08:14 UTC
rendered paste body
The query I want to be executed:sql="SELECT COUNT(table1.id) as nr FROM table1 WHERE table1.id <= %s AND table1.group = %s" % \    (current_row.id, current_row.group)Its context:mapper(MyObject, my_table, properties={    'group' : my_table.c.gr,    #obviously I don't get the part below    'nr' : column_property(            select(                [func.count(my_table.c.id)],                 [my_table.c.id <= current_row.id, my_table.c.gr = current_row.group]            ).label('nr')        )})