hi,

just wondering why the virtual field ordered on grid is not follow as 
defined in the models.
e.g.
*models/db.py*
db.define_table('product', 
Field('name'), 
Field('beginning_cost', 'integer'), 
Field('beginning_quantity', 'integer'), 
Field.Virtual('beginning_inventory', lambda row: row.product.beginning_cost 
* row.product.beginning_quantity),
Field('final_cost', 'integer'), 
Field('actual_quantity', 'integer'), 
Field.Virtual('actual_inventory', lambda row: row.product.final_cost * 
row.product.actual_quantity),
format = '%(name)s')

*controllers/default.py*
def product():
fields = dict(product = [db.product.id,db.product.name, 
db.product.beginning_cost, db.product.beginning_quantity, 
 db.product.beginning_inventory, db.product.final_cost, 
db.product.actual_quantity, 
 db.product.actual_inventory], 
  purchase_detail = None, sale_detail = None)
grid = SQLFORM.smartgrid(db.product)
#grid = SQLFORM.grid(db.product)
return locals()

in order to get the same order like on the define table, i must explicit 
tell it on the fields grid signature. is this normal or i did something 
wrong?

thanks and best regards,
stifan

-- 
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/groups/opt_out.

Reply via email to