Django

Code

Changeset 3044

Show
Ignore:
Timestamp:
05/31/06 23:47:56 (2 years ago)
Author:
adrian
Message:

Fixed #1454 -- Improved DB API quote_only_if_word() so that it doesn't quote 'select' parameters that are not all word characters. Thanks, dja@cdc.msbx.net

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/models/query.py

    r3019 r3044  
    44from django.dispatch import dispatcher 
    55from django.utils.datastructures import SortedDict 
    6  
    76import operator 
     7import re 
    88 
    99# For Python 2.3 
     
    6060 
    6161def quote_only_if_word(word): 
    62     if ' ' in word: 
     62    if re.search('\W', word): # Don't quote if there are spaces or non-word chars. 
    6363        return word 
    6464    else: