mapper() not working when using unicode literal as backref name

Issue #1330 resolved
Former user created an issue

This mapper() call:

mapper(Parent, parent_table, 
  properties={'children': relation(Child, backref=u'parent')})

fails with the following exception:

.../SQLAlchemy-0.5.2-py2.6.egg/sqlalchemy/orm/properties.pyc in _post_init(self)
    993
    994             if self.backref is not None:
--> 995                 self.backref.compile(self)
    996         elif not mapper.class_mapper(self.parent.class_, compile=False)._get_property(self.key, raiseerr=False):
    997             raise sa_exc.ArgumentError("Attempting to assign a new relation '%s' to "

AttributeError: 'unicode' object has no attribute 'compile'
WARNING: Failure executing file: <sabug.py>

Comments (3)

  1. Log in to comment