I just started in this SQLAlchemy ORM and I was wondering, if after calling a commit to a session, if you can still use that sesison to query and maybe even commit another time.
So, for example
session = Session()
session.add(Foo())
session.commit()
print session.query(Foo).first()
session.add(Bar())
session.commit()
Would all this code work?
Short answer: Yes.
Long answer: Please read Using the Session and also the Managing Transactions part of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With