When inserting/updating to table, I need the values to be uppercased. I found this solution, but it does not work for me. My table:
class User(DBBase):
tablename = 'user'
...
birthplace = sa.Column(sa.String, nullable=True)
@validates('birthplace')
def convert_upper(self, key, value):
return value.upper()
When i'm doing
conn.execute(User.__table__.insert({'birthplace': 'new york'}))
the 'new york' is being saved to db instead of expected 'NEW YORK'. Thanks for your help!