sqlalchemy / sqlalchemy

The Database Toolkit for Python
https://www.sqlalchemy.org
MIT License
9.59k stars 1.43k forks source link

eagerload doesn't work with synonym #485

Closed sqlalchemy-bot closed 17 years ago

sqlalchemy-bot commented 17 years ago

Migrated issue, originally created by Anonymous

If you have use the synonym feature of the ORM, eagerload doesn't have any affect if you use the synonym name. Take a look at the test script for an example. I create a column called "_bar" and a synonym called "bar" than refers to it. If I do eagerload("_bar") things work normally, if I do eagarload("bar") there isn't a join.


Attachments: example.py

sqlalchemy-bot commented 17 years ago

Anonymous wrote:

Example script

sqlalchemy-bot commented 17 years ago

Michael Bayer (@zzzeek) wrote:

indeed. your example needs the synonym set up as synonym('_bar'). fix for this issue + test committed in changeset:2342. should also fix it for "defer"/"undefer" but the unit test only looks at "eagerload".

sqlalchemy-bot commented 17 years ago

Changes by Anonymous:

sqlalchemy-bot commented 17 years ago

Changes by Michael Bayer (@zzzeek):