I don't think that's a bug.
Once you specify fields, you have to identify which fields you want to see
for all the linked tables. In other words your fields arg should be
something like this:
fields = [
db.auth_user.first_name,db.auth_user.last_name,db.auth_user.username,db.auth_user.email,
db.auth_membership.group_id
]
Then do something like this before you set up the grid.
db.auth_membership.group_id.represent = lambda value,row:
db.auth_group[value].role
Also setting csv=False still shuts off all export classes and suppresses
the "Export" label.
On Monday, April 1, 2013 11:32:00 AM UTC-4, Sverre wrote:
>
> I have a strange behaviour of the SQLFORM.smartgrid.
>
> I have this controller to do my own user management:
>
> @auth.requires_membership('admin')
> def user():
> exportclasses = dict(xml=False, html=False, csv=False, json=False, tsv
> =False, tsv_with_hidden_cols=False, csv_with_hidden_cols=False)
> fields = [db.auth_user.first_name,db.auth_user.last_name,db.auth_user.
> username,db.auth_user.email]
> form = SQLFORM.smartgrid(db.auth_user,
> exportclasses=exportclasses,
> paginate=settings.pagination,
> fields=fields
> )
>
> But when I' follwing the link to the membership table, I get the headers
> of the auth_user table as long as I'm using the fields argument.
>
> A other bug is the display of "Export:" when all exportclasses are
> switched off.
>
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.