type object has no attribute 'c'

Issue #2210 resolved
Former user created an issue

Hi,

I think I've come across a regression in 0.7.1 compared to 0.7.0. I'm getting the error below with 0.7.1 but with 0.7.0 all is fine.

I could try to reduce this to a test case but since I'm currently short on time I was hoping that by looking at the error message you can tell what's wrong. Please let me know if you need anything else.

Traceback (most recent call last):
  File "/software/python/2.6.6/lib/python2.6/runpy.py", line 122, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/software/python/2.6.6/lib/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/julians/dev/foo/lib/python/foo/qhost_updater.py", line 18, in <module>
    from foo.model import Host
  File "/home/julians/dev/foo/lib/python/foo/model.py", line 975, in <module>
    Index('idx_che_int__variable_id__event_time', VariableHistoryIntEntry.variable_id, VariableHistoryIntEntry.event_time, postgres_where=and_(VariableHistoryIntEntry.queue==None, VariableHistoryIntEntry.host==None))
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/sql/operators.py", line 217, in __eq__
    return self.operate(eq, other)
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/orm/attributes.py", line 123, in operate
    return op(self.comparator, *other, **kwargs)
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/orm/properties.py", line 387, in __eq__
    if self.property.direction in [MANYTOMANY](ONETOMANY,):
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/util/langhelpers.py", line 432, in __get__
    obj.__dict__[self.__name__](self.__name__) = result = self.fget(obj)
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/orm/properties.py", line 695, in property
    configure_mappers()
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/orm/mapper.py", line 2719, in configure_mappers
    mapper._post_configure_properties()
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/orm/mapper.py", line 1035, in _post_configure_properties
    prop.init()
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/orm/interfaces.py", line 121, in init
    self.do_init()
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/orm/properties.py", line 901, in do_init
    self._determine_synchronize_pairs()
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/orm/properties.py", line 1188, in _determine_synchronize_pairs
    True)
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/orm/properties.py", line 1099, in _sync_pairs_from_join
    if self._columns_are_mapped(l, r)
  File "/software/sqlAlchemy/0.7.1/lib/python2.6/sqlalchemy/orm/properties.py", line 1046, in _columns_are_mapped
    and self.secondary.c.contains_column(c):
AttributeError: type object 'Job' has no attribute 'c'

Comments (1)

  1. Mike Bayer repo owner

    This is a mapped class such as Job being passed as the "secondary" argument to the relationship() function. This is not supported in any version of SQLAlchemy.

  2. Log in to comment