summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2005-12-29 00:41:24 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2005-12-29 00:41:24 +0000
commit38cb94232e22b07fd139bb68be8d6e3b8e566fb9 (patch)
tree92a2d499bf7361c2e2dd51c0172b4b90e62a1c23 /lib/sqlalchemy
parent0101da1da4dc71604193fa48c6b7eb1c4fc72a6e (diff)
downloadsqlalchemy-38cb94232e22b07fd139bb68be8d6e3b8e566fb9.tar.gz
removed assignmapper
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/mapping/__init__.py26
1 files changed, 1 insertions, 25 deletions
diff --git a/lib/sqlalchemy/mapping/__init__.py b/lib/sqlalchemy/mapping/__init__.py
index cc405beb5..acb6798e9 100644
--- a/lib/sqlalchemy/mapping/__init__.py
+++ b/lib/sqlalchemy/mapping/__init__.py
@@ -28,7 +28,7 @@ from mapper import *
from properties import *
import mapper as mapperlib
-__all__ = ['relation', 'eagerload', 'lazyload', 'noload', 'deferred', 'assignmapper', 'column',
+__all__ = ['relation', 'eagerload', 'lazyload', 'noload', 'deferred', 'column',
'defer', 'undefer',
'mapper', 'clear_mappers', 'objectstore', 'sql', 'extension', 'class_mapper', 'object_mapper', 'MapperExtension',
'assign_mapper'
@@ -70,30 +70,6 @@ def column(*columns, **kwargs):
def deferred(*columns, **kwargs):
return DeferredColumnProperty(*columns, **kwargs)
-
-class assignmapper(object):
- """
- **this class is deprecated**
-
- provides a property object that will instantiate a Mapper for a given class the first
- time it is called off of the object. This is useful for attaching a Mapper to a class
- that has dependencies on other classes and tables which may not have been defined yet."""
- def __init__(self, table, class_ = None, **kwargs):
- self.table = table
- self.kwargs = kwargs
- if class_:
- self.__get__(None, class_)
-
- def __get__(self, instance, owner):
- if not hasattr(self, 'mapper'):
- self.mapper = mapper(owner, self.table, **self.kwargs)
- self.mapper._init_class()
- if self.mapper.class_ is not owner:
- raise "no match " + repr(self.mapper.class_) + " " + repr(owner)
- if not hasattr(owner, 'c'):
- raise "no c"
- return self.mapper
-
def mapper(class_, table = None, engine = None, autoload = False, *args, **params):
"""returns a new or already cached Mapper object."""
if table is None: