I know you want to modify the query, but you could replace the string
when the rows are passed to a helper instance.

On 26 feb, 13:05, Paul <[email protected]> wrote:
> In the dal I'm selecting two summed fields and adding them together,
> the column name in the set object ends up being called
> '(SUM(t_appointment.miles_to) + SUM(t_appointment.miles_from))', how
> would I define the dal query to get an better column name (e.g.
> total_miles) ?
>
> Current query is:
>
> def mileage():
>     mysum = db.t_appointment.miles_to.sum()
> +db.t_appointment.miles_from.sum()
>     groupyyyymm = db.t_appointment.f_start_time.year()|
> db.t_appointment.f_start_time.month()
>     rows = db().select(
>         mysum,
>         db.t_appointment.f_start_time.year(),
>         db.t_appointment.f_start_time.month(),
>     groupby=groupyyyymm)
>
>     return dict(rows=rows, sql = db._lastsql)
>
> Thanks,
>
> Paul

Reply via email to