From b22edf1d8a16467a8d5625f4ddf7dca9403bdfe0 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 11 Dec 2008 23:28:01 +0000 Subject: - turn __visit_name__ into an explicit member. [ticket:1244] --- lib/sqlalchemy/sql/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/sql/util.py') diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 547753b28..9b9b9ec09 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -121,7 +121,7 @@ def join_condition(a, b, ignore_nonexistent_tables=False): else: return sql.and_(*crit) - + class Annotated(object): """clones a ClauseElement and applies an 'annotations' dictionary. @@ -146,7 +146,9 @@ class Annotated(object): try: cls = annotated_classes[element.__class__] except KeyError: - raise KeyError("Class %s has not defined an Annotated subclass" % element.__class__) + cls = annotated_classes[element.__class__] = type.__new__(type, + "Annotated%s" % element.__class__.__name__, + (Annotated, element.__class__), {}) return object.__new__(cls) def __init__(self, element, values): -- cgit v1.2.1