Must disable eagerloads when doing Query.update()

Issue #1378 resolved
Former user created an issue

This is just a small annoyance, but when doing a Query.update() on a table with eagerloaded relations, one has to explicitly disable eagerloads first (e.g. Query.enable_eagerloads(False)), otherwise SQLAlchemy complains with the following message:

  File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.2-py2.5.egg/sqlalchemy/orm/query.py", line 1641, in update
    raise sa_exc.ArgumentError("Only update via a single table query is currently supported")
ArgumentError: Only update via a single table query is currently supported

Comments (4)

  1. Michael Trier

    So we can either turn it off automatically or we can modify the error text to possibly suggest it. Thoughts?

  2. Former user Account Deleted

    Replying to empty:

    So we can either turn it off automatically or we can modify the error text to possibly suggest it. Thoughts?

    Unless I'm missing something, eagerloads are useless on an update() query, so they should probably be turned off automatically.

  3. Log in to comment