=======
0.6.1
=====
+- orm
+ - Fixed regression introduced in 0.6.0 involving improper
+ history accounting on mutable attributes. [ticket:1782]
+
- sql
- Fixed bug that prevented implicit RETURNING from functioning
properly with composite primary key that contained zeroes.
self, state, v)
def check_mutable_modified(self, state, dict_):
- v = dict_.get(self.key, NO_VALUE)
- a, u, d = History.from_attribute(self, state, v)
+ a, u, d = self.get_history(state, dict_)
return bool(a or d)
def get(self, state, dict_, passive=PASSIVE_OFF):
from sqlalchemy import Integer, String, ForeignKey, literal_column
from sqlalchemy.test.schema import Table
from sqlalchemy.test.schema import Column
-from sqlalchemy.orm import mapper, relationship, create_session, column_property
+from sqlalchemy.orm import mapper, relationship, create_session, column_property, attributes
from sqlalchemy.test.testing import eq_, ne_
from test.orm import _base, _fixtures
from test.engine import _base as engine_base
assert session.query(Foo).one().data == pickleable.Bar(4, 19)
+ @testing.resolve_artifact_names
+ def test_resurrect_two(self):
+ f1 = Foo()
+ f1.data = pickleable.Bar(4,5)
+ session = create_session(autocommit=False)
+ session.add(f1)
+ session.commit()
+
+ session = create_session(autocommit=False)
+ f1 = session.query(Foo).first()
+ del f1 # modified flag flips by accident
+ gc.collect()
+ f1 = session.query(Foo).first()
+ assert not attributes.instance_state(f1).modified
+
@testing.resolve_artifact_names
def test_unicode(self):
"""Equivalent Unicode values are not flagged as changed."""