- changed milestone to 0.5.xx
Must disable eagerloads when doing Query.update()
Issue #1378
resolved
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)
-
-
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.
-
Account Deleted (original author: ants) Eagerloads shouldn't modify the matched relations so turning them off automatically is correct. Fixed in 7d0c5f72f9e6bd811f741c6f553e81b4093c252f.
-
repo owner - removed milestone
Removing milestone: 0.5.4 (automated comment)
- Log in to comment
So we can either turn it off automatically or we can modify the error text to possibly suggest it. Thoughts?