title: Sqlalchemy delete subquery
body: <p>I am trying to delete some child rows using a filtered query without result:</p>
  
  <pre><code>sl = DBSession.query(Puesto.id).filter(Puesto.locales_id == id).subquery()
  DBSession.query(Servicio).filter(Servicio.puestos_id.in_(sl)).delete()
  </code></pre>
  
  <p>I am getting <code>InvalidRequestError: Could not evaluate current criteria in Python.  Specify 'fetch' or False for the synchronize_session parameter.</code> as error.</p>
  
  <p>Full stack trace:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/src/tg2env/ceaf/ceaf/controllers/root.py", line 1673, in delete_local
      DBSession.query(Servicio).filter(Servicio.puestos_id.in_(sl)).delete()
    File "/usr/src/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.6.6-py2.4.egg/sqlalchemy/orm/query.py", line 2126, in delete
      raise sa_exc.InvalidRequestError(
  InvalidRequestError: Could not evaluate current criteria in Python.  Specify 'fetch' or False for the synchronize_session parameter.
  </code></pre>
  
  <p>I am not be able to find where the problem is...</p>
  
  <p>Any idea?</p>
  
  <p>Regards</p>