Re: [sqlalchemy] Using identity_key in after_commit session event (SQLAlchemy 0.6.7)

2011-05-25 Thread Torsten Landschoff
On Thu, 2011-05-26 at 08:34 +0200, Torsten Landschoff wrote: > basic question: Can I call identity_key in after_commit? If not, are there > any alternatives? A bit of extra information: My usage of identity_key stems from this thread on this list: http://groups.google.com/group/sqlalchemy/browse

[sqlalchemy] Using identity_key in after_commit session event (SQLAlchemy 0.6.7)

2011-05-25 Thread Torsten Landschoff
Hi Michael et al, basic question: Can I call identity_key in after_commit? If not, are there any alternatives? Explanation: For our GUI application I tried to extend SQLAlchemy to signal database updates. The following constraints apply: * Updates are done in background threads and should

Re: [sqlalchemy] Getting AppenderQuery to inherit from my caching_query class, instead of from Query?

2011-05-25 Thread Michael Bayer
On May 25, 2011, at 2:15 PM, bill curtis wrote: > Excellent, this seems to be working! > > It looks like the AppenderMixin defines it's own version of __iter__() and > count(). > > My CachingQuery does this as well. I have versions of those two functions > that check/set the cache, forwardin

Re: [sqlalchemy] Getting AppenderQuery to inherit from my caching_query class, instead of from Query?

2011-05-25 Thread bill curtis
Excellent, this seems to be working! It looks like the AppenderMixin defines it's own version of __iter__() and count(). My CachingQuery does this as well. I have versions of those two functions that check/set the cache, forwarding to the Query versions to hit the db if necessary. So what I'm d

Re: [sqlalchemy] Seemingly unnecessary queries for object already in the session get executed when using create_eager option.

2011-05-25 Thread Michael Bayer
On May 25, 2011, at 12:34 PM, mdob wrote: > Consider a simple model like this: > > Library 1---* Shelf 1---* Book > > Accordingly our model has the following relationships declared: > > {tu wkelj kod z relationship wlaczajac backrefy) > > We will write a query with a join to get all three obj

[sqlalchemy] Seemingly unnecessary queries for object already in the session get executed when using create_eager option.

2011-05-25 Thread mdob
Consider a simple model like this: Library 1---* Shelf 1---* Book Accordingly our model has the following relationships declared: {tu wkelj kod z relationship wlaczajac backrefy) We will write a query with a join to get all three objects at once SELECT * FROM Library JOIN Shelf ON Library.id =