From: Mike Bayer Date: Mon, 17 Oct 2011 17:26:26 +0000 (-0400) Subject: - Fixed bug in history_meta.py example where X-Git-Tag: rel_0_7_4~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=438e63db068860cfe04224567a65e710df77d15e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Fixed bug in history_meta.py example where the "unique" flag was not removed from a single-table-inheritance subclass which generates columns to put up onto the base. --- diff --git a/CHANGES b/CHANGES index f18854abdf..4807a39d1d 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,14 @@ ======= CHANGES ======= +0.7.4 +===== +- examples + - Fixed bug in history_meta.py example where + the "unique" flag was not removed from a + single-table-inheritance subclass which + generates columns to put up onto the base. + 0.7.3 ===== - general diff --git a/examples/versioning/history_meta.py b/examples/versioning/history_meta.py index 5f3820f680..9544451eec 100644 --- a/examples/versioning/history_meta.py +++ b/examples/versioning/history_meta.py @@ -60,6 +60,7 @@ def _history_mapper(local_mapper): for column in local_mapper.local_table.c: if column.key not in super_history_mapper.local_table.c: col = column.copy() + col.unique = False super_history_mapper.local_table.append_column(col) table = None diff --git a/examples/versioning/test_versioning.py b/examples/versioning/test_versioning.py index 5baf09530c..d91f12037a 100644 --- a/examples/versioning/test_versioning.py +++ b/examples/versioning/test_versioning.py @@ -228,7 +228,7 @@ class TestVersioning(TestCase): class SubClass(BaseClass): - subname = Column(String(50)) + subname = Column(String(50), unique=True) __mapper_args__ = {'polymorphic_identity':'sub'} self.create_tables() @@ -263,6 +263,11 @@ class TestVersioning(TestCase): ] ) + # test the unique constraint on the subclass + # column + sc.name ="modifyagain" + sess.flush() + def test_unique(self): class SomeClass(Versioned, Base, ComparableEntity): __tablename__ = 'sometable' diff --git a/lib/sqlalchemy/__init__.py b/lib/sqlalchemy/__init__.py index 0b9b7a00e9..aa303e85cf 100644 --- a/lib/sqlalchemy/__init__.py +++ b/lib/sqlalchemy/__init__.py @@ -117,7 +117,7 @@ from sqlalchemy.engine import create_engine, engine_from_config __all__ = sorted(name for name, obj in locals().items() if not (name.startswith('_') or inspect.ismodule(obj))) -__version__ = '0.7.3' +__version__ = '0.7.4' del inspect, sys