Вопрос

I have some tables in joined-table inheritance, a subclass has a synonym property for parent column:

class Parent(DeclarativeBase):
    # ...
    parent_column = Column(String(255))

class Child(Parent):
    # ...
    child_column = synonym('parent_column')

    @validates('child_column')  # @validates('parent_column') also does not work
    def validator(self, name, value):
        # not called at all
        raise ValueError()

I'am missing something? Is this not currently possible?

Это было полезно?

Решение

Currently this is a limitation of SQLAlchemy, see bug: #2943

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top