hello folks,

i'm using the linked_tables in smartgrid, but it is not show up. no errors 
occured, but the show is not expected.  the table is referenced and i'm not 
using response.models to run and not using modules. check on response 
toolbar only the header table is loaded the detail table is not loaded. 
check on database administration the detail that refer to the header is 
linked (detail rows that refer to the header can be clicked to the header). 
any idea how to fix it?
*code :*
*models/purchase.py*
db.define_table('purchase_header', 
Field('purchase_no'), 
Field('purchase_date', 'date'), 
Field('supplier', 'reference supplier'), 
Field('reference'), 
Field('total', 'integer'), 
format = '%(purchase_no)s')

db.define_table('purchase_detail', 
Field('purchase_no', 'reference purchase_header'), 
Field('product', 'reference product'), 
Field('quantity', 'integer'), 
Field('price', 'integer'), 
Field('amount', 'integer'), 
Field('total', 'integer'), 
format = '%(purchase_no)s')

*controllers/report.py*
def report_purchase():
#from gluon.debug import dbg
#dbg.set_trace()
purchase_detail = ['purchase_detail']
#grid = SQLFORM.smartgrid(db.purchase_header, 
linked_tables=['purchase_detail'], fields=fields, links=purchase_links, 
create=create, editable=editable, deletable=deletable, details=details, 
showbuttontext=False)
grid = SQLFORM.smartgrid(db.purchase_header, 
linked_tables=['purchase_detail'])
#grid = SQLFORM.smartgrid(db.purchase_header)
return locals()

*response toolbar db tables :*
sqlite://citifone.sqlite:defined:auth_usercategoryproductpurchase_header
supplierlazy:auth_casauth_eventauth_groupauth_membershipauth_permission
chart_of_accountpayment_detailpayment_headerpurchase_detailsale_detail
sale_header

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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to