summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-02-01 21:38:16 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-02-01 21:38:16 +0000
commite4247ef92a8a33506458f9b2f4977753c08a6e94 (patch)
treeaa6ff8ee4c74059f139bcabdb779efa6517e8481 /lib
parent154a831822c21ade7ff445381b1cacceb717e1e8 (diff)
downloadsqlalchemy-e4247ef92a8a33506458f9b2f4977753c08a6e94.tar.gz
- clear_mappers() just blows away all of ArgSingleton for now
- lazy clause goes against parent.mapped_table instead of parent.local_table, helps it to recognize self-referential condition between a descendant joined-table-inheritance mapper
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/__init__.py3
-rw-r--r--lib/sqlalchemy/orm/strategies.py4
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/__init__.py b/lib/sqlalchemy/orm/__init__.py
index a933cb1b2..3fab0e63e 100644
--- a/lib/sqlalchemy/orm/__init__.py
+++ b/lib/sqlalchemy/orm/__init__.py
@@ -9,6 +9,7 @@ the mapper package provides object-relational functionality, building upon the s
packages and tying operations to class properties and constructors.
"""
from sqlalchemy import exceptions
+from sqlalchemy import util as sautil
from sqlalchemy.orm.mapper import *
from sqlalchemy.orm import mapper as mapperlib
from sqlalchemy.orm.query import Query
@@ -74,10 +75,10 @@ def clear_mappers():
when new mappers are created, they will be assigned to their classes as their primary mapper."""
for mapper in mapper_registry.values():
attribute_manager.reset_class_managed(mapper.class_)
- mapper.class_key.dispose()
if hasattr(mapper.class_, 'c'):
del mapper.class_.c
mapper_registry.clear()
+ sautil.ArgSingleton.instances.clear()
def clear_mapper(m):
"""remove the given mapper from the storage of mappers.
diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py
index 1cdf0b177..19868ba13 100644
--- a/lib/sqlalchemy/orm/strategies.py
+++ b/lib/sqlalchemy/orm/strategies.py
@@ -156,7 +156,7 @@ class LazyLoader(AbstractRelationLoader):
def init(self):
super(LazyLoader, self).init()
(self.lazywhere, self.lazybinds, self.lazyreverse) = self._create_lazy_clause(
- self.parent.local_table,
+ self.parent.mapped_table,
self.mapper.select_table,
self.polymorphic_primaryjoin,
self.polymorphic_secondaryjoin,
@@ -250,7 +250,7 @@ class LazyLoader(AbstractRelationLoader):
binds = {}
reverse = {}
- #print "PARENTTABLE", parenttable, "TARGETTABLE", targettable
+ #print "PARENTTABLE", parenttable, "TARGETTABLE", targettable, "PJ", primaryjoin
def should_bind(targetcol, othercol):
# determine if the given target column is part of the parent table