I am moving from version 1.0.14 to version 1.4.11 of sqlalchemy.

I need to get a callback when all of the data from orm query is loaded not just 
single instance.

In the 1.0 version I created the session using query_cls:

self.session = Session(bind=engine, autoflush=False,
       _enable_transaction_accounting=False, autocommit=True,
        query_cls=my_query)

and the query class
class my_query(Query):

    def _execute_and_instances(self, context):
        results = list(super(my_query, self)._execute_and_instances(context))
        rdbm_events.run_created()
        for instance in results:
            yield instance

    def instances(self, cusor, __context=None):
        results = list(super(my_query, self).instances(cusor, __context))
        rdbm_events.run_created()
        for instance in results:
            yield instance

This does not work for 1.4.11.
What is the best way to get a callback when all
the data from query or lazy/deferred  loaded into instances ?

--
SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/164552c2-f11a-526b-abae-a8287afdf3e6%40mlb.org.

Reply via email to