I want to update the column c
in table t
with some function such as unicodedata.normalize
session.query(t).update({t.c: unicodedata.normalize('NFKC',t.c)})
But in this case I get the error like argument 2 must be str, not InstrumentedAttribute
. Which seems that I cannot map the function to the table directly.
I know I can use the examples in this question to update data by session.query
and then session.commit
. But I still wonder whether I can use some mapping function to realize that.