[web2py] Re: dal aggregation sum fields None

2011-10-23 Thread Anthony
On Sunday, October 23, 2011 5:14:17 PM UTC-4, Massimo Di Pierro wrote: > > I am not happy with extra. > > Currently we have three mechanisms to deal with "extra" fields. > table._extra, lazy virtual fields, links in grid/smartgrid. None of > them are undocumented in the book which means that for

[web2py] Re: dal aggregation sum fields None

2011-10-23 Thread Massimo Di Pierro
I am not happy with extra. Currently we have three mechanisms to deal with "extra" fields. table._extra, lazy virtual fields, links in grid/smartgrid. None of them are undocumented in the book which means that for none of them we promise backward compatibility. Massimo On Oct 23, 2:27 pm, Antho

[web2py] Re: dal aggregation sum fields None

2011-10-23 Thread Anthony
On Sunday, October 23, 2011 3:16:56 PM UTC-4, Massimo Di Pierro wrote: > > You are right. I misunderstood the issue. > Do you think assignments to _extra should be enabled (transparently, not by directly hacking the _extra dictionary), or should _extra remain read-only? The current behavior is a

[web2py] Re: dal aggregation sum fields None

2011-10-23 Thread Massimo Di Pierro
You are right. I misunderstood the issue. On Oct 23, 11:21 am, Anthony wrote: > On Sunday, October 23, 2011 11:49:31 AM UTC-4, Massimo Di Pierro wrote: > > > lines[cash_price]=lines(cash_price) or 0   > > I don't think that will solve the problem. That will add a new > 'SUM(orderline.cash_price)'

[web2py] Re: dal aggregation sum fields None

2011-10-23 Thread Anthony
On Sunday, October 23, 2011 11:49:31 AM UTC-4, Massimo Di Pierro wrote: > > lines[cash_price]=lines(cash_price) or 0 > I don't think that will solve the problem. That will add a new 'SUM(orderline.cash_price)' key to lines rather than updating lines._extra['SUM(orderline.cash_price)']. However

[web2py] Re: dal aggregation sum fields None

2011-10-23 Thread Massimo Di Pierro
lines[cash_price]=lines(cash_price) or 0  On Oct 22, 7:50 am, Anthony wrote: > On Saturday, October 22, 2011 7:47:08 AM UTC-4, apple wrote: > > > I am summing some data using the DAL: > >       cash_price = db.orderline.cash_price.sum() > >       lines = db(db.orderline.order_ == id).select(cash_

[web2py] Re: dal aggregation sum fields None

2011-10-22 Thread Anthony
On Saturday, October 22, 2011 7:47:08 AM UTC-4, apple wrote: > > I am summing some data using the DAL: > cash_price = db.orderline.cash_price.sum() > lines = db(db.orderline.order_ == id).select(cash_price).first() > > However if there are no lines then lines[cash_price] is "None". S