From 146e0515d8c8f991857fb3cf27a6b9a5583d25d1 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 29 Apr 2007 22:26:39 +0000 Subject: - restored old "column_property()" ORM function (used to be called "column()") to force any column expression to be added as a property on a mapper, particularly those that aren't present in the mapped selectable. this allows "scalar expressions" of any kind to be added as relations (though they have issues with eager loads). --- lib/sqlalchemy/sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql.py') diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index a7ca55e31..6858084de 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -1617,7 +1617,7 @@ class FromClause(Selectable): if not raiseerr: return None else: - raise exceptions.InvalidRequestError("Given column '%s', attached to table '%s', failed to locate a corresponding column from table '%s'" % (str(column), str(column.table), self.name)) + raise exceptions.InvalidRequestError("Given column '%s', attached to table '%s', failed to locate a corresponding column from table '%s'" % (str(column), str(getattr(column, 'table', None)), self.name)) def _get_exported_attribute(self, name): try: -- cgit v1.2.1