Django

Code

Changeset 1503

Show
Ignore:
Timestamp:
11/29/05 20:36:26 (3 years ago)
Author:
adrian
Message:

Moved parse_sql import in django.utils.httpwrappers to the top of the module, not inside QueryDict?.init()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/utils/httpwrappers.py

    r1502 r1503  
    33from urllib import urlencode 
    44from django.utils.datastructures import MultiValueDict 
     5 
     6try: 
     7    # The mod_python version is more efficient, so try importing it first. 
     8    from mod_python.util import parse_qsl 
     9except ImportError: 
     10    from cgi import parse_qsl 
    511 
    612class HttpRequest(object): # needs to be new-style class because subclasses define "property"s 
     
    6268    This is immutable unless you create a copy of it.""" 
    6369    def __init__(self, query_string): 
    64         try: 
    65             from mod_python.util import parse_qsl 
    66         except ImportError: 
    67             from cgi import parse_qsl 
    6870        if not query_string: 
    6971            self.data = {}