Chris Withers wrote: > All the tests bar test_mapper_args_composite pass, and that currently > blows up with a rather bizarre:
There's a Column there getting sent to the mapper that doesn't yet have a key. It's None, so you get that error. Declarative sets up those keys/names on the columns in the metaclass so somehow this test is messing up the order of initialization. I'll try to have a deeper look. > > Traceback (most recent call last): > File "test_mixable.py", line 177, in test_mapper_args_composite > class MyModel(Base,MyMixin1,MyMixin2): > File "mixable.py", line 27, in __init__ > return DeclarativeMeta.__init__(cls, classname, bases, dict_) > File > "/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/ext/declarative.py", > line 561, in __init__ > _as_declarative(cls, classname, dict_) > File > "/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/ext/declarative.py", > line 554, in _as_declarative > cls.__mapper__ = mapper_cls(cls, table, properties=our_stuff, > **mapper_args) > File > "/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/orm/__init__.py", > line 751, in mapper > return Mapper(class_, local_table, *args, **params) > File > "/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/orm/mapper.py", > line 198, in __init__ > self._configure_properties() > File > "/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/orm/mapper.py", > line 514, in _configure_properties > if self._should_exclude(col.key, col.key, local=False): > File > "/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/orm/mapper.py", > line 985, in _should_exclude > if getattr(self.class_, assigned_name, None)\ > TypeError: Error when calling the metaclass bases > getattr(): attribute name must be string > > Any idea what's causing that? If I move the type_ columns the the > __mapper_args__ to MyModel, the tests passes... > > (also note evilness required because declarative gets __table_args__ > from dict_ rather than the cls, where it should ;-) ) > > cheers, > > Chris > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalch...@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.