mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-06-03 06:19:59 -04:00
- 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:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user