From: Mike Bayer Date: Sun, 7 Feb 2010 00:18:15 +0000 (+0000) Subject: add a note about type for ColumnElement X-Git-Tag: rel_0_6beta2~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54df3ee2ab1052533f49e596d902d597eb140c52;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add a note about type for ColumnElement --- 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