]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
add a note about type for ColumnElement
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 7 Feb 2010 00:18:15 +0000 (00:18 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 7 Feb 2010 00:18:15 +0000 (00:18 +0000)
lib/sqlalchemy/ext/compiler.py

index 56502bd28f8ca1f064faa519f2e260af3c4b53e3..7861096f9ee3d7dc127c4a193d7bf1de9e04e5d4 100644 (file)
@@ -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