Re: [sqlalchemy] Any examples of using session events?

2014-10-14 Thread Simon King
On Tue, Oct 14, 2014 at 12:53 PM, Eugene Prikazchikov eprik...@gmail.com wrote: I am struggling to understand how to use session events. I want to track insertsupdates in some model and depending on certain criteria modify objects from other model. Judging from docs, I cannot use before_update

[sqlalchemy] How can I keep SQLAlchemy DB connection alive for always?

2014-10-14 Thread Eren Gölge
I a create a session with these following lines; Base = declarative_base() engine = create_engine( 'mysql://sentio_reader:therea...@sentiodb.cloudapp.net/sentio') #engine = create_engine('mysql://erogol:ern88GOL!@sentioerogol.cloudapp.net/sentio_data') # engine.echo = True metadata =

Re: [sqlalchemy] How can I keep SQLAlchemy DB connection alive for always?

2014-10-14 Thread Robert Forkel
Pessimistic disconnect handling may be what you are looking for: http://docs.sqlalchemy.org/en/latest/core/pooling.html#disconnect-handling-pessimistic On Tue, Oct 14, 2014 at 9:27 PM, Eren Gölge erengo...@gmail.com wrote: I a create a session with these following lines; Base =

[sqlalchemy] are there any shortcuts for subquery loading a collection - ie, after query

2014-10-14 Thread Jonathan Vanasco
give this example: class Foo(): bars = relationship(Bar) class Bar(): foos = relationship(Foo) loaded_Foo = s.query(Foo) is it possible to issue a subqueryload for `bars` on the collection of `loaded_Foo` objects ? I strongly doubt it, but figure it is worth