Although the official documentation is very robust and detailed, one thing
I noticed is not very clear.
When specifying arguments for a relationship like this:
class Bonus(Base):
....
basis = relationship("Accomplishment", uselist=False, lazy='joined')
whenever there is "uselist=False", the eager-loading doesn't happen,
regardless of setting the lazy='joined' or not.
If I load the Bonus object and expunge it from the session, and then try to
access the 'basis' attribute, I will get a
'sqlalchemy.orm.exc.DetachedInstanceError'.
Is uselist=False naturally incompatible with eager-loading? If so, what is
the underlying reasong? Thanks.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sqlalchemy/68998421-8f9e-4484-bf02-a93a49f09cd8n%40googlegroups.com.