diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-06-26 17:20:17 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-06-26 17:20:17 -0400 |
commit | 29eb88eefbe859ccd13cf44a8b6b310ae8b27507 (patch) | |
tree | 66f989654dcb02625681c7ca6ff46d3dbd2e0a44 /lib/sqlalchemy/sql/util.py | |
parent | 3eab7982537426d4dc1c467df1371dea3b0a0a4e (diff) | |
download | sqlalchemy-29eb88eefbe859ccd13cf44a8b6b310ae8b27507.tar.gz |
- Fixed bug that would prevent overridden clause
compilation from working for "annotated" expression
elements, which are often generated by the ORM.
Diffstat (limited to 'lib/sqlalchemy/sql/util.py')
-rw-r--r-- | lib/sqlalchemy/sql/util.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index d0af0a9d6..c999ab786 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -259,7 +259,7 @@ class Annotated(object): self.__dict__ = element.__dict__.copy() self.__element = element self._annotations = values - + def _annotate(self, values): _values = self._annotations.copy() _values.update(values) @@ -270,7 +270,10 @@ class Annotated(object): def _deannotate(self): return self.__element - + + def _compiler_dispatch(self, visitor, **kw): + return self.__element.__class__._compiler_dispatch(self, visitor, **kw) + @property def _constructor(self): return self.__element._constructor @@ -300,7 +303,6 @@ annotated_classes = {} for cls in expression.__dict__.values() + [schema.Column, schema.Table]: if isinstance(cls, type) and issubclass(cls, expression.ClauseElement): exec "class Annotated%s(Annotated, cls):\n" \ - " __visit_name__ = cls.__visit_name__\n"\ " pass" % (cls.__name__, ) in locals() exec "annotated_classes[cls] = Annotated%s" % (cls.__name__) |