Flask/SQLAlchemy - WHERE NOT EXISTS
<p>How could I translate this:</p>

<pre><code>SELECT id, 
FROM user
WHERE NOT EXISTS (SELECT * 
                  FROM user_agency_assoc 
                  WHERE user.ID = user_agency_assoc.user_id)
AND user.invited_by IS NOT NULL
</code></pre>

<p>as an SQLAlchemy ORM query?</p>