From b6619f267ba6a327d6bff1aa650dd3ab9b718b29 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 13 May 2019 14:56:12 -0400 Subject: Continue to assume None for un-accessed attribute on persistent object during m2o fetch Fixed regression in new relationship m2o comparison logic first introduced at :ref:`change_4359` when comparing to an attribute that is persisted as NULL and is in an un-fetched state in the mapped instance. Since the attribute has no explicit default, it needs to default to NULL when accessed in a persistent setting. Fixes: #4676 Change-Id: I17160c30131187c735f025a785ff0276a246f6bb --- lib/sqlalchemy/orm/relationships.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy') diff --git a/lib/sqlalchemy/orm/relationships.py b/lib/sqlalchemy/orm/relationships.py index 008cfcd2a..b40fad332 100644 --- a/lib/sqlalchemy/orm/relationships.py +++ b/lib/sqlalchemy/orm/relationships.py @@ -1574,7 +1574,7 @@ class RelationshipProperty(StrategizedProperty): state, dict_, column, - passive=attributes.PASSIVE_RETURN_NEVER_SET + passive=attributes.PASSIVE_OFF if state.persistent else attributes.PASSIVE_NO_FETCH ^ attributes.INIT_OK, ) -- cgit v1.2.1