Reputation: 15050
This is my ORM object:
my_model = models.MyModel.find_by_id(1)
How do I get the SQLAlchemy session number that this object is attached to?
Upvotes: 2
Views: 2803
Reputation: 15050
To get the session ID:
my_model._sa_instance_state.session_id
Upvotes: 5