Can I define custom insert behaviour in a #SQLAlchemy ORM-mapped class which is used when I call sqlalchemy.orm.Session.add
and perhaps sqlalchemy.orm.Session.bulk_save_objects
?
This is so I would not have to make sure to use a custom MyData.insert method, but could just rely on the usual mechanisms of SQLAlchemy: session.add(my_data)
.
I have looked for, for example an insert method in ORM-mapped classes to override, but I have not found anything like that.
[#]Python
=> More informations about this toot | View the thread | More toots from arildsen@fosstodon.org
=> View python tag | View sqlalchemy tag This content has been proxied by September (3851b).Proxy Information
text/gemini