Currently this is a limitation of SQLAlchemy, see bug: #2943
SQLAlchemy validator method is not triggered for synonym
-
20-07-2023 - |
Frage
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?
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow