title: Using sqlalchemy result set for update
body: <p>Really 2 questions here.</p>
  
  <p>If I run a sqlalchemy query like this:</p>
  
  <pre><code>sensors = session.query(Sensor).filter(Sensor.serial_number.in_(data['sensor_serial_numbers'])).all()
  </code></pre>
  
  <p>Can I then use the result set (sensors) to update a column in all those rows? I couldn't figure out the syntax for that, so I tried doing this:</p>
  
  <pre><code>session.query(Sensor).filter(Sensor.serial_number.in_(data['sensor_serial_numbers'])).update({'system_id': system.id})
  </code></pre>
  
  <p>But that fails way down in the bowls of sqlalchemy:</p>
  
  <pre><code>  File "/home/ecovent/pyenv0.3/local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 949, in _do_pre_synchronize
      "Could not evaluate current criteria in Python. "
  InvalidRequestError: Could not evaluate current criteria in Python. Specify 'fetch' or False for the synchronize_session parameter.
  </code></pre>
  
  <p>I think that must be because of the in_ clause, as I've done updates before using that same construct, but they did not have an in_ clause. How would I do an update like this with an in_?</p>