Commits

Mike Bayer committed c0e9edc

Fixed `__repr__()` on mapper property constructs
to work before the object is initialized, so
that Sphinx builds with recent Sphinx versions
can read them.

Comments (0)

Files changed (2)

doc/build/changelog/changelog_08.rst

     :version: 0.8.1
 
     .. change::
+      :tags: bug, orm
+
+      Fixed `__repr__()` on mapper property constructs
+      to work before the object is initialized, so
+      that Sphinx builds with recent Sphinx versions
+      can read them.
+
+    .. change::
       :tags: bug, sql, postgresql
 
       The _Binary base type now converts values through

lib/sqlalchemy/orm/interfaces.py

     def __repr__(self):
         return '<%s at 0x%x; %s>' % (
             self.__class__.__name__,
-            id(self), self.key)
+            id(self), getattr(self, 'key', 'no key'))
 
 class PropComparator(operators.ColumnOperators):
     """Defines boolean, comparison, and other operators for