some_alg = sess.query(Alg).get(8)
sess.query(Email).filter(~Email.threads.any(Thread.alg==some_alg))
The clause Thread.alg=some alg *should* just generate the clause
thread.algid=8...it shouldn't pull in the alg table at all since
its not needed for many-to-one comparison.
That works
On May 28, 2008, at 8:24 PM, EricHolmberg wrote:
CREATE TABLE alg (id INT NOT NULL, name VARCHAR(32));
CREATE TABLE email (id INT NOT NULL, subject VARCHAR(256));
CREATE TABLE thread (id INT NOT NULL, algid INT, emailid INT);
This is great, I get my list of emails that don't have any