I am creating an application that has a one-to-many table that
references the same table twice:
db.define_table('product',
Field('title', required=True, unique=True),
Field('sku', required = True, unique=True),
Field('description', 'text'),
format = '%(title)s'
)
db.define_table('related_product',
Field('product_id', db.product, writable=False),
Field('product', 'reference product'),
)
If I create a smartgrid on the 'product' table using:
def product():
return dict(grid=SQLFORM.smartgrid(
db.product,
linked_tables=['related_product'],
))
the "related_product" table appears twice because it references the
"product" table twice. Any way to prevent this?
-Jim