Matt Wilson schrieb:
I think this thread is relevant to a problem I'm wrestling with.
I've got users, roles, and projects, each being a RelatedJoin to the
other. I don't know how to select any users that have the role "X" on
project "Y".
Something along these lines (untested):
u2r = Alias('user_role')
r2p = Alias('role_project')
User.select(AND(User.q.id == u2r.user_id, u2r.role_id == r2p.role_id,
r2p.project_id == Project.q.id, Project.q.name == 'Y', Role.q.name == 'X')
Diez
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---