From 67e63bc7c472d959f3fac954afd1858e18dd4453 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 30 Dec 2009 04:53:23 +0000 Subject: [PATCH] formatting fix --- lib/sqlalchemy/ext/compiler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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. -- 2.47.2