From: Peter G. <pe...@fs...> - 2004-03-09 17:30:26
|
Hello. I'm looking to make a regular join, but with testing. I have two tables (simplified for the example): class Project(SQLObject): permissions = MultipleJoin("Permission") class Permission(SQLObject): person = ForeignKey("person") project = ForeignKey("Project") type = EnumCol(enumValues = ['A', 'B', 'C']) The SQL for the select would be something like: SELECT project.* FROM project, permission WHERE permission.project_id = project.project_id AND permission.person_id = 666; I don't know in the beginning of the program which projects actualy contain permissions, otherwise I'd just do a myproject.permissions, what I want to do is actualy select all projects that have permissions for a certain user. How can this be done? /Peter Gebauer |