문제

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