From 54df3ee2ab1052533f49e596d902d597eb140c52 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 7 Feb 2010 00:18:15 +0000 Subject: [PATCH] add a note about type for ColumnElement --- lib/sqlalchemy/ext/compiler.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/sqlalchemy/ext/compiler.py b/lib/sqlalchemy/ext/compiler.py index 56502bd28f..7861096f9e 100644 --- a/lib/sqlalchemy/ext/compiler.py +++ b/lib/sqlalchemy/ext/compiler.py @@ -131,6 +131,14 @@ A big part of using the compiler extension is subclassing SQLAlchemy expression "column-like" elements. Anything that you'd place in the "columns" clause of a SELECT statement (as well as order by and group by) can derive from this - the object will automatically have Python "comparison" behavior. + + :class:`~sqlalchemy.sql.expression.ColumnElement` classes want to have a + ``type`` member which is expression's return type. This can be established + at the instance level in the constructor, or at the class level if its + generally constant:: + + class timestamp(ColumnElement): + type = TIMESTAMP() * :class:`~sqlalchemy.sql.expression.FunctionElement` - This is a hybrid of a ``ColumnElement`` and a "from clause" like object, and represents a SQL -- 2.47.3