]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
column.label is now a function; fix byroot example, add 'default_label' accessor...
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 2 Jan 2006 05:45:37 +0000 (05:45 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 2 Jan 2006 05:45:37 +0000 (05:45 +0000)
examples/adjacencytree/byroot_tree.py
lib/sqlalchemy/sql.py

index 58b16e4c126dfca8f98eba1f0b8ef813797d4d72..80768bd5c6af5c333a19a194f3560a608ce59bed 100644 (file)
@@ -68,7 +68,7 @@ class TreeLoader(MapperExtension):
     def create_instance(self, mapper, row, imap, class_):
         """creates an instance of a TreeNode.  since the TreeNode constructor requires
         the 'name' argument, this method pulls the data from the database row directly."""
-        return TreeNode(row[mapper.c.name.label], _mapper_nohistory=True)
+        return TreeNode(row[mapper.c.name], _mapper_nohistory=True)
     def after_insert(self, mapper, instance):
         """runs after the insert of a new TreeNode row.  The primary key of the row is not determined
         until the insert is complete, since most DB's use autoincrementing columns.  If this node is
index 51b1b51f91a91d9a42b99b28083ce1970aa94c03..4386c3e5d89dcc66bb1d700adb9150836189b087 100644 (file)
@@ -865,6 +865,7 @@ class ColumnImpl(ColumnElement):
             self._label = self.column.name
 
     engine = property(lambda s: s.column.engine)
+    default_label = property(lambda s:s._label)
     
     def label(self, name):
         return Label(name, self.column)