Skip to content
Browse files

Fixed #1454 -- Improved DB API quote_only_if_word() so that it doesn'…

…t quote 'select' parameters that are not all word characters. Thanks,

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent a371eb3 commit b4be0d2487532766a8709c0333e63ecbee96427d @adrianholovaty adrianholovaty committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/db/models/
4 django/db/models/
@@ -3,8 +3,8 @@
from django.db.models import signals
from django.dispatch import dispatcher
from django.utils.datastructures import SortedDict
import operator
+import re
# For Python 2.3
if not hasattr(__builtins__, 'set'):
@@ -59,7 +59,7 @@ def orderlist2sql(order_list, opts, prefix=''):
return ', '.join(output)
def quote_only_if_word(word):
- if ' ' in word:
+ if'\W', word): # Don't quote if there are spaces or non-word chars.
return word
return backend.quote_name(word)

0 comments on commit b4be0d2

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