Toot

Written by Thomas Arildsen on 2024-10-21 at 15:54

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

Mentions

Tags

=> View python tag | View sqlalchemy tag

Proxy Information
Original URL
gemini://mastogem.picasoft.net/toot/113346219720700801
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
229.456875 milliseconds
Gemini-to-HTML Time
0.453411 milliseconds

This content has been proxied by September (3851b).