I need left-outer-join help that has added complexity beyond the simplified 
example I gave

This query below works perfect if used by itself except doesn't have the 
outer join feature

query = ((db.StaffPosition.jobClassification==db.JobClassification.id)& 
(db.StaffPositionOrganization.staffPosition==db.StaffPosition.id) & 
(db.StaffPositionOrganization.organizationID==specificOrganization.id)  & 
(db.StaffPosition.superObjectID==db.auth_membership.superObjectID)  & 
(db.auth_membership.group_id==db.auth_group.id) & 
(db.auth_group.roleType==50)) 

All records are correct

But if I run grid using it below, it generates way too many rows

grid = SQLFORM.grid(db.JobClassification, left = db.StaffPosition.on(query))

If I change grid to look like below, it gets better but still has a couple 
of extra rows.

grid = SQLFORM.grid(db.JobClassification, left = 
[db.StaffPosition.on(query), db.auth_group.on(query), 
db.auth_membership.on(query), db.StaffPositionOrganization.on(query)]) 

There only one outer join needed (JobClassification and StaffPosition) but 
the above "left" arguments seem to help.

If I simplify query like below, it works perfect in grid with left outer 
join, but it doesn't have the additional tables to create needed fields.

query = ((db.StaffPosition.jobClassification==db.JobClassification.id))

Any tips appreciated,

Alex Glaros

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to