title: multi-tenancy with sqlalchemy - can't seem change query on event.listen
body: <p>I want to add a company_id filter to all queries to the database with sqlalchemy.</p>
  <p>I've got the event firing with the below.</p>
  <pre><code>from sqlalchemy import event
  
  def my_load_listener(target, context):
      print(&quot;on load!&quot;)
  
  event.listen(Settings, 'load', my_load_listener)
  </code></pre>
  <p>Looks like I can get a select object with <code>context.query</code> but I've used the below to try and add a filter but cant get it to work.</p>
  <pre><code>context.query = context.query.where(Settings.id == 2)
  </code></pre>
  <p>Is it possible to intercept a models query / insert and amend it on the fly?</p>
  <p>Ideally it would be achievable on a global scope so I don't have to add events for all models.</p>