Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Implemented quote_name() for ado_mssql DB backend. Thanks, Jakub Laba…

…th and Eugene Lazutkin

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1176 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 565a19470204bddde62a17537666eb6e3c9be852 1 parent 632b63a
Adrian Holovaty authored November 11, 2005

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  django/core/db/backends/ado_mssql.py
5  django/core/db/backends/ado_mssql.py
@@ -111,8 +111,9 @@ def get_relations(cursor, table_name):
111 111
     raise NotImplementedError
112 112
 
113 113
 def quote_name(name):
114  
-    # TODO: Figure out how MS-SQL quotes database identifiers.
115  
-    return name
  114
+    if name.startswith('[') and name.endswith(']'):
  115
+        return name # Quoting once is enough.
  116
+    return '[%s]' % name
116 117
 
117 118
 OPERATOR_MAPPING = {
118 119
     'exact': '=',

0 notes on commit 565a194

Please sign in to comment.
Something went wrong with that request. Please try again.