I have a problem with row coming back form mapped class that has relations.
The session is created with:
self.session = Session(bind=self._engine, autoflush=False,
_enable_transaction_accounting=False, autocommit=True,
weak_identity_map=True)
The problem occurs with instance on that have already been loaded and the query
ask for lazyload of some of the relations. The first query load a bunch of
row. The
second query does the follow:
query = session.query(mapped_class)
query = query.with_lockmode('update')
query = query.options(lazyload(relation1)
query = query.options(lazyload(relation2)
query = query.filter_by(id=234)
query = query.populate_existing()
rows = query.all()
In the rows relation1 and relation2 both are not none. All the data in
relation1 and relation2 is
None. If I remove the lazyload and try it I get data in relation1 and relation2.
What I am trying to do is update the instance to match the data and create
locks for
all but the tables that are lazyload.
There are no other references to relation1 and relation2.
I have not verified but It look like if a relation has other references the
relation has data in it
columns.
This happens in both 0.5b3 and 0.5rc1.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---