cls.table = Table(table_name, _metadata, autoload=True, **table_opts)
cls.columns = cls.table._columns
- # check for inheritence
if version_id_col is not None:
version_id_col_object = getattr(cls.table.c, version_id_col, None)
assert(version_id_col_object is not None, "version_id_col (%s) does not exist." % version_id_col)
+ # check for inheritence
if hasattr(bases[0], "mapping"):
cls._base_mapper= bases[0].mapper
assign_mapper(objectstore.context, cls, cls.table,
"""
pass
+
def is_primary(self):
"""Return True if this ``MapperProperty``'s mapper is the
primary mapper for its class.
return strategy
def setup(self, querycontext, **kwargs):
+
self._get_context_strategy(querycontext).setup_query(querycontext, **kwargs)
def execute(self, selectcontext, instance, row, identitykey, isnew):
# if we adapted the given generic type to a database-specific type,
# but it turns out the originally given "generic" type
# is actually a subclass of our resulting type, then we were already
- # were given a more specific type than that required; so use that.
+ # given a more specific type than that required; so use that.
if (issubclass(typeobj.__class__, impltype)):
return typeobj
return typeobj.adapt(impltype)
pass
def testconstructorexceptions(self):
- """test that exceptions raised raised in the mapped class are not masked by sa decorations"""
+ """test that exceptions raised in the mapped class are not masked by sa decorations"""
ex = AssertionError('oops')
sess = create_session()