if any synonyms were in use.
wouldn't be deserialized correctly when the whole object
was serialized. [ticket:1426]
+ - Fixed bug whereby session.is_modified() would raise an exception
+ if any synonyms were in use.
+
- Fixed Query being able to join() from individual columns of
a joined-table subclass entity, i.e.
query(SubClass.foo, SubcClass.bar).join(<anything>).
state = attributes.instance_state(instance)
except exc.NO_STATE:
raise exc.UnmappedInstanceError(instance)
+ dict_ = state.dict
for attr in state.manager.attributes:
- if not include_collections and hasattr(attr.impl, 'get_collection'):
+ if \
+ (
+ not include_collections and
+ hasattr(attr.impl, 'get_collection')
+ ) or not hasattr(attr.impl, 'get_history'):
continue
- (added, unchanged, deleted) = attr.get_history(instance, passive=passive)
+
+ (added, unchanged, deleted) = \
+ attr.impl.get_history(state, dict_, passive=passive)
+
if added or deleted:
return True
return False
assert s.is_modified(user)
assert not s.is_modified(user, include_collections=False)
+ @testing.resolve_artifact_names
+ def test_is_modified_syn(self):
+ s = sessionmaker()()
+
+ mapper(User, users, properties={'uname':sa.orm.synonym('name')})
+ u = User(uname='fred')
+ assert s.is_modified(u)
+ s.add(u)
+ s.commit()
+ assert not s.is_modified(u)
@testing.resolve_artifact_names
def test_weak_ref(self):