From b769988c9c6f34b2c704f5b90707d538b747fe18 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 2 Jan 2006 05:45:37 +0000 Subject: [PATCH] column.label is now a function; fix byroot example, add 'default_label' accessor to columnimpl --- examples/adjacencytree/byroot_tree.py | 2 +- lib/sqlalchemy/sql.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/adjacencytree/byroot_tree.py b/examples/adjacencytree/byroot_tree.py index 58b16e4c12..80768bd5c6 100644 --- a/examples/adjacencytree/byroot_tree.py +++ b/examples/adjacencytree/byroot_tree.py @@ -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 diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index 51b1b51f91..4386c3e5d8 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -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) -- 2.47.2