First I would rewrite it as

def view_totals():
    rows = db().select(db.tableorder.ALL,
db.tableorder.totalsale.sum(),groupby=db.tableorder.orderdate)
    for row in rows: print
row.tableorder.ordernumber,row[db.tableorder.totalsale.sum()]
    return dict(rows=rows)

<table>
{{for row in rows:}}
<tr><td>{{= row.tableorder.ordernumber}}</
td><td>{{=row[db.tableorder.totalsale.sum()]}}</td></tr>
{{pass}}
</table>

On May 11, 12:37 pm, greenpoise <[email protected]> wrote:
> I have this:
>
> def view_totals():
>     rows = db().select(db.tableorder.ALL, 'sum(tableorder.totalsale)',
> groupby=db.tableorder.orderdate)
>     for row in rows: print row.tableorder.ordernumber,
> row._extra['sum(tableorder.totalsale)']
>     return dict()
>
> What would be my view to present my sum?

Reply via email to