Hi there, I have a table tblPerson that has a m:n relation with a table tblFlag using an association table tblCompany_has_Flag
now I would like to find all persons, that do not have assigned any of list of flags. what I have tried among other things is the following: s = session.query(tblPerson) s = s.join(tblCompany_has_Flag, tblFlag) s = s.join(tblCompany) s = s.filter(not_(tblFlag.__table__.c.name.in_(['a','b']))) however this does not create a valid sql statement. I would be grateful if somebody could tell me how to build the query correctly. thanks robert --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---