This is really a question for web2py-users, but assuming that what you wanted was all the users who were in both "manager" and "assistant", it would be something like
rows = db((db.auth_membership == mgr_grp_id) && \
(db.auth_membership.group_id == asst_grp_id)).select(db.auth_membership.user_id)
The schema for auth_membership has 2 foreign keys (both fields are of type "references"), so you need to look in the referenced tables to interpret the values. You could do a join with auth_user to get names or email, for instance. (I'd get the desired group ids in a separate query, just to keep things readable.--
mgr_grp_id = db(db.auth_group.role == "manager").select().first().id
for instance)
/dps