[web2py] Re: compute field and reference

2011-10-13 Thread Anthony
Good point. On Thursday, October 13, 2011 8:13:54 PM UTC-4, pbreit wrote: > > Yeah, just seemed weird that quantity was relational, unless perhaps the > type of quantity varies (ie, boxes, teaspoons, dozens, etc.). But then you > have to do more than just multiple.

[web2py] Re: compute field and reference

2011-10-13 Thread pbreit
Yeah, just seemed weird that quantity was relational, unless perhaps the type of quantity varies (ie, boxes, teaspoons, dozens, etc.). But then you have to do more than just multiple.

[web2py] Re: compute field and reference

2011-10-13 Thread Anthony
On Thursday, October 13, 2011 11:36:34 AM UTC-4, pbreit wrote: > > Quantity is not a number? What does your quantity table look like? db.item.quantity is a reference to db.quantity.id, so it's a number, but not the quantity of interest. Presumably there's a field in db.quantity that stores the

[web2py] Re: compute field and reference

2011-10-13 Thread pbreit
Quantity is not a number? What does your quantity table look like?

[web2py] Re: compute field and reference

2011-10-13 Thread Anthony
Does this work: compute=lambda r: r['unit_price'] * db.quantity(r['quantity']).quantity_field 'quantity_field' would be the name of the field in db.quantity that stores the quantity you want to multiply. Anthony On Thursday, October 13, 2011 9:30:14 AM UTC-4, andrej burja wrote: > > what is t