[Sqlalchemy-commits] commit/sqlalchemy: zzzeek: - Fixed a very old behavior where the lazy load emi
Brought to you by:
zzzeek
From: Bitbucket <com...@bi...> - 2014-03-28 00:39:42
|
1 new commit in sqlalchemy: https://bitbucket.org/zzzeek/sqlalchemy/commits/825d3b0d6db4/ Changeset: 825d3b0d6db4 Branch: None User: zzzeek Date: 2014-03-28 01:38:46 Summary: - Fixed a very old behavior where the lazy load emitted for a one-to-many could inappropriately pull in the parent table, and also return results inconsistent based on what's in the parent table, when the primaryjoin includes some kind of discriminator against the parent table, such as ``and_(parent.id == child.parent_id, parent.deleted == False)``. While this primaryjoin doesn't make that much sense for a one-to-many, it is slightly more common when applied to the many-to-one side, and the one-to-many comes as a result of a backref. Loading rows from ``child`` in this case would keep ``parent.deleted == False`` as is within the query, thereby yanking it into the FROM clause and doing a cartesian product. The new behavior will now substitute the value of the local "parent.deleted" for that parameter as is appropriate. Though typically, a real-world app probably wants to use a different primaryjoin for the o2m side in any case. fixes #2948 Affected #: 4 files Repository URL: https://bitbucket.org/zzzeek/sqlalchemy/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |