Grid can do joins. Smartgrids cannot. The latter is "smart" in the sense
that it displays only one table at the time but knows how to link other
tables automatically.
In principle it should be possible to make left joins work. Please open a
suggestion for improvement with an example on google issues
Massimo
On Sunday, 3 June 2012 11:21:44 UTC-5, weheh wrote:
>
> I'm running SQLFORM.smartgrid with a left= join as follows:
>
> grid = SQLFORM.smartgrid(
> db.url_queue,
> constraints=dict(url_queue=query),
> left=db.brand.on(
> (auth.accessible_query('read', db.brand, auth.user_id))
> &
> (db.brand.id == db.url_queue.brand_id)
> ),
> fields=[...],
> headers={...},
> paginate=20,
> maxtextlength=100,
> searchable=True,
> deletable=True,
> editable=False,
> details=False,
> create=False,
> ui='web2py',
> linked_tables=[],
> )
> The left join is causing smartgrid to give me an "unsupported query"error
> message
> . If I comment out the left= arg, the error message goes away but the
> query returns the wrong data, as expected. Any help would be appreciated.
> Thanks.
>