From 752f2e0fc8dec13e313a00f7c9720d24d21429ed Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 29 May 2014 19:54:51 -0400 Subject: - Adjustment to attribute mechanics concerning when a value is implicitly initialized to None via first access; this action, which has always resulted in a population of the attribute, now emits an attribute event just like any other attribute set operation and generates the same kind of history as one. Additionally, many mapper internal operations will no longer implicitly generate these "None" values when various never-set attributes are checked. These are subtle behavioral fixes to attribute mechanics which provide a better solution to the problem of :ticket:`3060`, which also involves recognition of attributes explicitly set to ``None`` vs. attributes that were never set. fixes #3061 --- lib/sqlalchemy/orm/sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/orm/sync.py') diff --git a/lib/sqlalchemy/orm/sync.py b/lib/sqlalchemy/orm/sync.py index aed98bdf0..7556e9f71 100644 --- a/lib/sqlalchemy/orm/sync.py +++ b/lib/sqlalchemy/orm/sync.py @@ -48,7 +48,7 @@ def clear(dest, dest_mapper, synchronize_pairs): for l, r in synchronize_pairs: if r.primary_key and \ dest_mapper._get_state_attr_by_column( - dest, dest.dict, r) is not None: + dest, dest.dict, r) not in orm_util._none_set: raise AssertionError( "Dependency rule tried to blank-out primary key " -- cgit v1.2.1