diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-02-07 00:18:15 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-02-07 00:18:15 +0000 |
commit | 54df3ee2ab1052533f49e596d902d597eb140c52 (patch) | |
tree | 368022aeef5acabc2bfebbca4abe2e8f02c7bd23 /lib/sqlalchemy/ext/compiler.py | |
parent | 342265ec3eff16fc2723f8e904a9cc7e1b12f943 (diff) | |
download | sqlalchemy-54df3ee2ab1052533f49e596d902d597eb140c52.tar.gz |
add a note about type for ColumnElement
Diffstat (limited to 'lib/sqlalchemy/ext/compiler.py')
-rw-r--r-- | lib/sqlalchemy/ext/compiler.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/compiler.py b/lib/sqlalchemy/ext/compiler.py index 56502bd28..7861096f9 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 |