summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/mapping/properties.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-04-06 21:12:00 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-04-06 21:12:00 +0000
commit5bda70e770489a09a848d5ac3bfbee0aabd805ab (patch)
tree081c39dfb9a8486f78f923de3e3843e5d10eb634 /lib/sqlalchemy/mapping/properties.py
parentc0e5bb085b052e016d75ecf8e0a24584a2de730a (diff)
downloadsqlalchemy-5bda70e770489a09a848d5ac3bfbee0aabd805ab.tar.gz
mapper's querying facilities migrated to new query.Query() object, which can receive session-specific context via the mapper.using() statement. reuslting object instances will be bound to this session, but query execution still handled by the SQLEngines implicit in the mapper's Table objects.
session now propigates to the unitofwork UOWTransaction object, as well as mapper's save_obj/delete_obj via the UOWTransaction it receives. UOWTransaction explicitly calls the Session for the engine corresponding to each Mapper in the flush operation, although the Session does not yet affect the choice of engines used, and mapper save/delete is still using the Table's implicit SQLEngine. changed internal unitofwork commit() method to be called flush(). removed all references to 'engine' from mapper module, including adding insert/update specific SQLEngine methods such as last_inserted_ids, last_inserted_params, etc. to the returned ResultProxy so that Mapper need not know which SQLEngine was used for the execute. changes to unit tests, SelectResults to support the new Query object.
Diffstat (limited to 'lib/sqlalchemy/mapping/properties.py')
-rw-r--r--lib/sqlalchemy/mapping/properties.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/mapping/properties.py b/lib/sqlalchemy/mapping/properties.py
index 592e4dc0a..af504100c 100644
--- a/lib/sqlalchemy/mapping/properties.py
+++ b/lib/sqlalchemy/mapping/properties.py
@@ -582,7 +582,7 @@ class LazyLoader(PropertyLoader):
(self.lazywhere, self.lazybinds) = create_lazy_clause(self.parent.noninherited_table, self.primaryjoin, self.secondaryjoin, self.foreignkey)
# determine if our "lazywhere" clause is the same as the mapper's
# get() clause. then we can just use mapper.get()
- self.use_get = not self.uselist and self.mapper._get_clause.compare(self.lazywhere)
+ self.use_get = not self.uselist and self.mapper.query._get_clause.compare(self.lazywhere)
def _set_class_attribute(self, class_, key):
# establish a class-level lazy loader on our class
@@ -609,14 +609,14 @@ class LazyLoader(PropertyLoader):
ident = []
for primary_key in self.mapper.pks_by_table[self.mapper.table]:
ident.append(params[primary_key._label])
- return self.mapper.get(session=session, *ident)
+ return self.mapper.using(session).get(*ident)
elif self.order_by is not False:
order_by = self.order_by
elif self.secondary is not None and self.secondary.default_order_by() is not None:
order_by = self.secondary.default_order_by()
else:
order_by = False
- result = self.mapper.select_whereclause(self.lazywhere, order_by=order_by, params=params, session=session)
+ result = self.mapper.using(session).select_whereclause(self.lazywhere, order_by=order_by, params=params)
else:
result = []
if self.uselist: