- attached ticket-1829-copy-column-unique.patch
Mixin drops column uniqueness (because Column.copy omits it)
Issue #1829
resolved
If I do this:
class MyMixin(object):
id = Column(Integer, primary_key=True)
value = Column(String, unique=True)
class MyModel(Base, MyMixin):
__tablename__ = 'test'
then MyModel.__table__.c.value.unique
is false — the column uniqueness specified by the mixin is silently dropped. This is because Column.copy
omits that attribute.
Attaching patch that fixes this, with tests. Breaks no tests.
Comments (6)
-
Account Deleted -
repo owner gah ! thanks, needs a test in test_metadata.py/MetaDataTest, that's where the copy() stuff goes
-
Account Deleted The patch does test it there — adds a case to
test_uninitialized_column_copy
-
repo owner ooh missed that, very nice
-
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.6.2 (automated comment)
- Log in to comment
Patch and unit tests for this issue