Note that it is *not* built/installed by default.
See README for installation instructions.
+- declarative
+ - DeclarativeMeta exclusively uses cls.__dict__ (not dict_)
+ as the source of class information; _as_declarative exclusively
+ uses the dict_ passed to it as the source of class information
+ (which when using DeclarativeMeta is cls.__dict__). This should
+ in theory make it easier for custom metaclasses to modify
+ the state passed into _as_declarative.
+
- mysql
- Fixed reflection bug whereby when COLLATE was present,
nullable flag and server defaults would not be reflected.
del our_stuff[key]
table = None
- if '__table__' not in cls.__dict__:
- if '__tablename__' in cls.__dict__:
+ if '__table__' not in dict_:
+ if '__tablename__' in dict_:
tablename = cls.__tablename__
- table_args = cls.__dict__.get('__table_args__')
+ table_args = dict_.get('__table_args__')
if isinstance(table_args, dict):
args, table_kw = (), table_args
elif isinstance(table_args, tuple):
else:
args, table_kw = (), {}
- autoload = cls.__dict__.get('__autoload__')
+ autoload = dict_.get('__autoload__')
if autoload:
table_kw['autoload'] = True
if cols:
for c in cols:
if not table.c.contains_column(c):
- raise exceptions.ArgumentError("Can't add additional column %r when specifying __table__" % key)
+ raise exceptions.ArgumentError(
+ "Can't add additional column %r when specifying __table__" % key)
mapper_args = getattr(cls, '__mapper_args__', {})
if 'inherits' not in mapper_args:
def __init__(cls, classname, bases, dict_):
if '_decl_class_registry' in cls.__dict__:
return type.__init__(cls, classname, bases, dict_)
-
- _as_declarative(cls, classname, dict_)
+
+ _as_declarative(cls, classname, cls.__dict__)
return type.__init__(cls, classname, bases, dict_)
def __setattr__(cls, key, value):
# hasattr() on a compile-loaded attribute
hasattr(User.addresses, 'property')
# the exeption is preserved
- assert_raises_message(sa.exc.InvalidRequestError, r"suppressed within a hasattr\(\)", compile_mappers)
+ assert_raises_message(sa.exc.InvalidRequestError,
+ r"suppressed within a hasattr\(\)", compile_mappers)
def test_custom_base(self):
class MyBase(object):