title: Using NOT EXISTS clause in sqlalchemy ORM query
body: <p>I want to convert the following raw sql query into a sqlalchemy ORM query :</p>
  
  <pre><code>SELECT * FROM kwviolations AS kwviol WHERE kwviol.proj_id=1 AND NOT EXISTS (SELECT * FROM
  kwmethodmetrics AS kwmetrics WHERE kwmetrics.kw_id=kwviol.kw_id AND kwmetrics.checkpoint_id=5);
  </code></pre>
  
  <p>I tried the following ORM query but didn't succeed:</p>
  
  <pre><code>self.session.query(KWViolations).filter(KWViolations.proj_id==project.id).\
  filter(and_(~KWViolations.kw_id.any(KWMethodMetrics.kw_id==KWViolations.kw_id),KWMethodMetrics.checkpoint_id==checkpoint.id))
  </code></pre>
  
  <p>Can anyone please help?
  Thanks in advance</p>