[Sqlalchemy-tickets] Issue #3575: @declared_attr cannot take in column_property (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
|
From: Daniel K. <iss...@bi...> - 2015-11-03 18:22:05
|
New issue 3575: @declared_attr cannot take in column_property https://bitbucket.org/zzzeek/sqlalchemy/issues/3575/declared_attr-cannot-take-in Daniel Kassen: In an effort to force multiple level polymorphism out of sqlalchemy, my colleague has devised a clever way to make multiple types of collections. To do this he creates a collections base which inherits from the 'polymorphic_on' class. All the attributes declared in this collection base class are decorated with @declared_attr, including the id, __mapper_args__, and title. the 'title' is inherited from the polymorphic class and is simply a unicode text type column. But because it is inherited, and redeclared in this new collections class, we get the following warning: SAWarning: Implicitly combining column assets.title with column collections.title under attribute 'title'. Please configure one or more attributes for these same-named columns explicitly. I tried fixing this warning by wrapping the Column object being returned with the column_property method(?). Apparently @declared_attr cannot take a column_property object, and if I'm guessing right thinking that a column_property(A, B) is a column of type A with the properties of B, then this should be fixed. It asks me to configure the column explicitly, and then complains when I do. Responsible: zzzeek |