Re: [sqlalchemy] Re: in_() operator is not currently implemented for many-to-one-relations - alternatives?

2010-03-19 Thread Michael Bayer
select document.* from document join tags on document.id=tags.document_id where tags.tag='foo' and tags.tag='bar' and tags.tag= am I missing something ? that would return no rows in most cases. if you want to find documents that have an exact list of tags, you'd have to do something like

Re: [sqlalchemy] Re: in_() operator is not currently implemented for many-to-one-relations - alternatives?

2010-03-19 Thread Conor
Stodge wrote: Thanks. That doesn't quite work. Based on my data, the following should (and does) work because it only returns document id=1, which only has these two tags: tag_list = ['my document', 'source code'] session.query(Document).\ filter(Document.tags.any(Tag.tag.in_([t for t