>
> def product_calc():
>     form = SQLFORM.factory(
>     Field('supplier',label='Supplier',requires=IS_IN_DB(db,db.supplier.id
> ,'%(name)s')),
>     
> Field('costprice',label='Cost/Price',requires=[IS_FLOAT_IN_RANGE(0,100),IS_NOT_EMPTY()]),
>     Field('uom',label='SQF or 
> PC',default='PC',requires=(IS_IN_SET(UOM_SET))))
>     
>     suplidor = db().select(db.supplier.id,db.supplier.discount)
>     thisrec = db.supplier(request.args)
>     
>
>     if form.process().accepted:
>
>         response.flash = 'form accepted'
>         session.supplier = form.vars.supplier        
>         session.costprice = form.vars.costprice
>         session.descuento = db.supplier.discount
>

db.supplier.discount is a DAL Field object, not a value of that field from 
an individual record. Presumably you want to set session.descuento to 
something like thisrec.discount or db.supplier(form.vars.supplier).discount.

As an aside, it helps if you explain the specific problem you are having 
(i.e., what do you expect, and what do you observer instead -- in 
particular, report any errors and tracebacks).

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to