- Added internal warning in case an instance without a

full PK happened to be expired and then was asked
to refresh. [ticket:1797]
This commit is contained in:
Mike Bayer
2010-05-13 15:45:56 -04:00
parent e352e255a7
commit f0fa460791
2 changed files with 13 additions and 0 deletions
+4
View File
@@ -16,6 +16,10 @@ CHANGES
fail during deserialize where parent InstanceState not
yet unserialized. [ticket:1802]
- Added internal warning in case an instance without a
full PK happened to be expired and then was asked
to refresh. [ticket:1797]
- sql
- expr.in_() now accepts a text() construct as the argument.
Grouping parenthesis are added automatically, i.e. usage
+9
View File
@@ -2095,6 +2095,15 @@ def _load_scalar_attributes(state, attribute_names):
else:
identity_key = mapper._identity_key_from_state(state)
if (_none_set.issubset(identity_key) and \
not mapper.allow_partial_pks) or \
_none_set.issuperset(identity_key):
util.warn("Instance %s to be refreshed doesn't "
"contain a full primary key - can't be refreshed "
"(and shouldn't be expired, either)."
% state_str(state))
return
result = session.query(mapper)._get(
identity_key,
refresh_state=state,