>
> hi guys sorry to intrude, i have a problem here
>
db.define_table('stock_status',
Field('Date', 'datetime', default=request.now, writable=False),
Field('SN'),
Field('item_description'),
Field('Quantity','integer'),
Field('UOM'),
Field('stockIN','integer'),
Field('stockOUT', 'integer'),
#Field('stock_at_hand','integer'),
Field('assignment')
)
class MyVirtualFields(object):
def total_price(self):
return self.stock_status.Quantity + self.stock_status.stockIN -
self.stock_status.stockOUT
db.stock_status.stock_at_hand.virtualfields.append(MyVirtualFields())
i would like to do stock_in_hand = Quantity+ stockIN - stockOUT
input to this table is done through an sql grid and i have searched all
over google and cant findout how to have a calculated field in grid, the
documentation says this wont be displayed also am getting this error
'Field' object has no attribute 'virtualfields'
please help!
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.