title: How to delete rows from a table using an SQLAlchemy query without ORM?
body: <p>I'm writing a quick and dirty maintenace script to delete some rows and would like to avoid having to bring my ORM classes/mappings over from the main project.  I have a query that looks similar to:</p>
  
  <pre><code>address_table = Table('address',metadata,autoload=True)
  addresses = session.query(addresses_table).filter(addresses_table.c.retired == 1)
  </code></pre>
  
  <p>According to everything I've read, if I was using the ORM (not 'just' tables) and passed in something like:</p>
  
  <pre><code>addresses = session.query(Addresses).filter(addresses_table.c.retired == 1)
  </code></pre>
  
  <p>I could add a <code>.delete()</code> to the query, but when I try to do this using only tables I get a complaint:</p>
  
  <pre><code>File "/usr/local/lib/python2.6/dist-packages/sqlalchemy/orm/query.py", line 2146, in delete
      target_cls = self._mapper_zero().class_
  AttributeError: 'NoneType' object has no attribute 'class_'
  </code></pre>
  
  <p>Which makes sense as its a table, not a class.  I'm quite green when it comes to SQLAlchemy, how should I be going about this?</p>