summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-06-23 19:50:23 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-06-23 19:50:23 -0400
commitf10eb28d90cbf73f4757897f52bf26722f98372e (patch)
tree0bf86fadcf85b1d254e1ae8bc32dd7db0c0e07d4 /lib/sqlalchemy
parent7e7447db1ff1a49f15269f6515a82607db9384f4 (diff)
downloadsqlalchemy-f10eb28d90cbf73f4757897f52bf26722f98372e.tar.gz
- reverse course in #3061 so that we instead no longer set None in the attribute
when we do a get; we return the None as always but we leave the dict blank and the loader callable still in place. The case for this implicit get on a pending object is not super common and there really should be no change in state at all when this operation proceeds. This change is more dramatic as it reverses a behavior SQLA has had since the first release. fixes #3061
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/attributes.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index df1f328b7..fecd74f30 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -556,15 +556,7 @@ class AttributeImpl(object):
def initialize(self, state, dict_):
"""Initialize the given state's attribute with an empty value."""
- old = NEVER_SET
- value = None
- if self.dispatch.set:
- value = self.fire_replace_event(state, dict_,
- None, old, None)
- state._modified_event(dict_, self, old)
-
- dict_[self.key] = value
- return value
+ return None
def get(self, state, dict_, passive=PASSIVE_OFF):
"""Retrieve a value from the given object.