On Wednesday, September 26, 2018 at 10:08:43 PM UTC-4, jens.t...@gmail.com
wrote:
>
>
> Suppose I get the “new”, “dirty”, and “deleted” sets as per discussion
> below, and I’m especially interested in the “dirty” set: is there a way to
> find out which properties of an object were modified,
I’d like to pick up this topic once more briefly.
Suppose I get the “new”, “dirty”, and “deleted” sets as per discussion
below, and I’m especially interested in the “dirty” set: is there a way to
find out which properties of an object were modified, or only that the
object was modified?
Thank you, the event worked like a charm :-) Though I think that I don't
need the commit events, because the application terminates anyway.
I modified your approach to gather which objects were flushed so that in
the end I can give the user more precise information:
Sure.
I'm working with two Pyramid/SQLAlchemy web servers, and in order to have a
more convenient way of looking at the db data I wrote a small tool which
essentially creates a db session, loads the server orm helper functions and
sets up an environment much like a view handler functions has.
Can you explain why you actually want to do this? There might be
better options than before_flush, but we'd need to know exactly what
you're trying to do first.
Simon
On Thu, Nov 16, 2017 at 12:55 PM, wrote:
> That makes sense, thank you, Simon!
>
> Regarding the
That makes sense, thank you, Simon!
Regarding the events: you suggest to use a before_flush() to examine
session.dirty whenever a session.query() executes?
Also, is there a way to get the list of objects that have been flushed, or
should I track them myself whenever a before_flush() event
On Thu, Nov 16, 2017 at 7:45 AM, wrote:
> Hello,
>
> I've been exploring some of the session functionality that handles object
> states, and I'm quite confused. Here is what I see:
>
engine = engine_from_config({'sqlalchemy.url': 'mysql+pymysql://…'})
Hello,
I've been exploring some of the session functionality that handles object
states, and I'm quite confused. Here is what I see:
>>> engine = engine_from_config({'sqlalchemy.url': 'mysql+pymysql://…'})
>>> session_factory = sessionmaker(bind=engine) # No autoflush
>>> session =