From: Mike Bayer Date: Wed, 30 Dec 2009 04:53:23 +0000 (+0000) Subject: formatting fix X-Git-Tag: rel_0_5_8~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67e63bc7c472d959f3fac954afd1858e18dd4453;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git formatting fix --- diff --git a/lib/sqlalchemy/ext/compiler.py b/lib/sqlalchemy/ext/compiler.py index f893538e8e..9fb7fd7120 100644 --- a/lib/sqlalchemy/ext/compiler.py +++ b/lib/sqlalchemy/ext/compiler.py @@ -93,11 +93,11 @@ Within the new compilation function, to get at the "original" compilation routin use the appropriate visit_XXX method - this because compiler.process() will call upon the overriding routine and cause an endless loop. Such as, to add "prefix" to all insert statements:: -from sqlalchemy.sql.expression import Insert + from sqlalchemy.sql.expression import Insert -@compiles(Insert) -def prefix_inserts(insert, compiler, **kw) - return compiler.visit_insert(insert.prefix_with("some prefix"), **kw) + @compiles(Insert) + def prefix_inserts(insert, compiler, **kw): + return compiler.visit_insert(insert.prefix_with("some prefix"), **kw) The above compiler will prefix all INSERT statements with "some prefix" when compiled.