Suddenly, after another test registration, "&" works fine. Not sure what's changed... Anyway, should I use "&" or "and" to combine the clauses?
On Monday, July 1, 2013 3:41:51 PM UTC+2, lesssugar wrote: > > Quick question: what's the proper way to combine *where *clauses in DAL? > > 1. When I use "&", I get doubled select results: > > db((db.auth_user.registration_key == 'pending') & > (db.auth_membership.group_id > == 2)).select(db.auth_user.id, db.auth_user.email) > > Result > > 3, [email protected] > 3, [email protected] > 4, [email protected] > 4, [email protected] > > 2. When I use "and", I get the same results as above *plus *doubled id > and email of user who does not belong to group_id(2)...: > > db((db.auth_user.registration_key == 'pending') and > (db.auth_membership.group_id > == 2)).select(db.auth_user.id, db.auth_user.email) > > Result: > > 3, [email protected] > 3, [email protected] > 4, [email protected] > 4, [email protected] > 5, [email protected] (has no group_id(2) membership) > 5, [email protected] (has no group_id(2) membership) > > -- --- 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.

