From 6169e192f7e26929b0fa98932ec2c8bb17ffb8f7 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Thu, 5 Jul 2012 09:21:52 -0500 Subject: [PATCH] varquote for mssql and postgresql --- VERSION | 2 +- gluon/dal.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d6d059ee..ffa503aa 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-07-04 23:30:47) dev +Version 2.00.0 (2012-07-05 09:21:49) dev diff --git a/gluon/dal.py b/gluon/dal.py index 13e4eba5..f465f7bf 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -2155,6 +2155,9 @@ class PostgreSQLAdapter(BaseAdapter): 'big-reference': 'BIGINT REFERENCES %(foreign_key)s ON DELETE %(on_delete_action)s', } + def varquote(self,name): + return '"%s"' % name + def adapt(self,obj): return psycopg2_adapt(obj).getquoted() @@ -2636,6 +2639,9 @@ class MSSQLAdapter(BaseAdapter): 'reference TFK': ' CONSTRAINT FK_%(foreign_table)s_PK FOREIGN KEY (%(field_name)s) REFERENCES %(foreign_table)s (%(foreign_key)s) ON DELETE %(on_delete_action)s', } + def varquote(self,name): + return '[%s]' % name + def EXTRACT(self,field,what): return "DATEPART(%s,%s)" % (what, self.expand(field))