I am trying to show the records in a table AND the count of referenced
items in a child table using SQLFORM.grid but am not able to get the left
join to work.
Here is what I have been trying for the past 2+ hours with no success
results= SQLFORM.grid(db.org,
fields=[db.org.name, db.org.jurisdiction,
db.org.otype, db.org.id],
left=db.org.on(db.auth_user.org_ref==db.org.id).count(),
deletable=False, details=True, create=False,
editable=False,
orderby=db.org.name.upper(),
maxtextlength=50, paginate=20, csv=False,
searchable=False)
return dict(results=results)
tested independently this works great.
This seems way to hard and there are no clear examples I can find.
Does anyone see what is wrong, have a working example of SQLFORM.grid
working with a left join, or have a different approach I can try??
--