I have a simple one-to-many relation like so:
db.define_table('person', Field('job'))
db.define_table('thing', Field('owner_id', 'reference person'))
And I built a grid using SQLFORM.grid like so:
grid = SQLFORM.grid((db.person.id == db.thing.owner_id),
fields=[db.thing.owner_id, db.person.job],
links=[dict(header='Details for thing',
body=thing_link)
],
)
With the function thing_link defined like this:
def thing_link(row):
print row
return A('controller', 'function', args=[row.thing.uuid])
I get a ticket when loading the grid, and as far as I can tell looking at the print in thing_link, the row passed in the body of the link does not contain both tables of the inner join : it only contains whichever comes first (so row.person in this case, in terms or alphabetical order).
Is there a way around this ?