properties added after a declarative class has been defined are incorrectly propagated to child classes.

Issue #1570 resolved
Former user created an issue

We are using a declarative mapper:

Base = sqlalchemy.ext.declarative.declarative_base(mapper=sqlalchemy.orm.mapper)

In a situation with two classes:

class Foo(Base):

and

class Bar(Foo):

appending a new Column to the parent class:

Foo.attr = sqlalchemy.Column(sqlalchemy.types.Integer)

before:

Base.metadata.create_all()

results in a badly behaving property of the class Bar (as shown in the attached test), which doesn't preserve its value after a commit. The property works ok when added in Foo class definition.

Comments (4)

  1. Log in to comment