Hello, all,
I have those 3 models bellow:
db.define_table('order',
db.Field('customer', db.customer),
db.Field('autor', db.auth_user),
db.Field('created', 'datetime'),
)
db.define_table('product',
db.Field('name'),
db.Field('value'),
format='%(name)s'
)
db.define_table('order_items',
db.Field('order_id', db.order, required=True),
db.Field('product_id', db.product, required=True),
db.Field('amount', 'integer', required=True, default=1),
db.Field('value','decimal(20,2)', required=True, default=0),
db.Field('total', compute=lambda r: (float(r['preco'] * r['quantidade'])
)
They are displayed as form for order record and bellow a SQLFORM.grid for
displaying order_items.
Is there a way for setting default value for order_items.value to be the
same as product.value, from parent table?
Also, is it possible to add a row for totals for a column?
Thanks for any suggestion
--
---
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/groups/opt_out.