self.table = table
if inherits is not None:
+ if self.class_.__mro__[1] != inherits.class_:
+ raise ArgumentError("Class '%s' does not inherit from '%s'" % (self.class_.__name__, inherits.class_.__name__))
self.primarytable = inherits.primarytable
# inherit_condition is optional.
if not table is inherits.noninherited_table:
if not self.props.has_key(key):
self.props[key] = prop.copy()
self.props[key].parent = self
- self.props[key].key = None # force re-init
+ # self.props[key].key = None # force re-init
l = [(key, prop) for key, prop in self.props.iteritems()]
for key, prop in l:
if getattr(prop, 'key', None) is None:
import sqlalchemy.sql as sql
import sqlalchemy.util as util
import mapper
+from sqlalchemy.exceptions import *
class Query(object):
"""encapsulates the object-fetching operations provided by Mappers."""