From 565a19470204bddde62a17537666eb6e3c9be852 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 11 Nov 2005 19:11:11 +0000 Subject: [PATCH] Implemented quote_name() for ado_mssql DB backend. Thanks, Jakub Labath and Eugene Lazutkin git-svn-id: http://code.djangoproject.com/svn/django/trunk@1176 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/db/backends/ado_mssql.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/django/core/db/backends/ado_mssql.py b/django/core/db/backends/ado_mssql.py index a673c4812e..480de3b074 100644 --- a/django/core/db/backends/ado_mssql.py +++ b/django/core/db/backends/ado_mssql.py @@ -111,8 +111,9 @@ def get_relations(cursor, table_name): raise NotImplementedError def quote_name(name): - # TODO: Figure out how MS-SQL quotes database identifiers. - return name + if name.startswith('[') and name.endswith(']'): + return name # Quoting once is enough. + return '[%s]' % name OPERATOR_MAPPING = { 'exact': '=',