summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-11-11 19:11:11 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-11-11 19:11:11 +0000
commit565a19470204bddde62a17537666eb6e3c9be852 (patch)
tree7bd347ff588efee4ca8eecde852ab1589e4529a0
parent632b63ad76efafff2f602de9c5a4464faa37d51b (diff)
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
-rw-r--r--django/core/db/backends/ado_mssql.py5
1 files 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': '=',