Commits

Remi Delon  committed 3b3278f

Renamed queryString into query_string

  • Participants
  • Parent commits 46bc454

Comments (0)

Files changed (4)

File cherrypy/_cperror.py

         
         if params is not None:
             if isinstance(params, basestring):
-                request.queryString = params
+                request.query_string = params
+                request.queryString = request.query_string # Backward compatibility
                 pm = cgi.parse_qs(params, keep_blank_values=True)
                 for key, val in pm.items():
                     if len(val) == 1:
                         pm[key] = val[0]
                 request.params = pm
             else:
-                request.queryString = urllib.urlencode(params)
+                request.query_string = urllib.urlencode(params)
+                request.queryString = request.query_string
                 request.params = params.copy()
         
         Exception.__init__(self, path, params)

File cherrypy/_cphttptools.py

         self.processRequestBody = method in ("POST", "PUT")
         
         self.path = path
-        self.queryString = qs
+        self.query_string = qs
+        self.queryString = qs # Backward compatibility
         self.protocol = proto
         
         # Change object_path in filters to change
     
     def processHeaders(self):
         
-        self.params = httptools.parseQueryString(self.queryString)
+        self.params = httptools.parseQueryString(self.query_string)
         self.paramMap = self.params # Backward compatibility
         
         # Process the headers into self.headers
     
     def _get_browser_url(self):
         url = self.base + self.path
-        if self.queryString:
-            url += '?' + self.queryString
+        if self.query_string:
+            url += '?' + self.query_string
         return url
     browser_url = property(_get_browser_url,
                           doc="The URL as entered in a browser (read-only).")

File cherrypy/lib/httptools.py

     
     return method, path, qs, protocol
 
-def parseQueryString(queryString, keep_blank_values=True):
-    """Build a paramMap dictionary from a queryString."""
-    if re.match(r"[0-9]+,[0-9]+", queryString):
+def parseQueryString(query_string, keep_blank_values=True):
+    """Build a paramMap dictionary from a query_string."""
+    if re.match(r"[0-9]+,[0-9]+", query_string):
         # Server-side image map. Map the coords to 'x' and 'y'
         # (like CGI::Request does).
-        pm = queryString.split(",")
+        pm = query_string.split(",")
         pm = {'x': int(pm[0]), 'y': int(pm[1])}
     else:
-        pm = cgi.parse_qs(queryString, keep_blank_values)
+        pm = cgi.parse_qs(query_string, keep_blank_values)
         for key, val in pm.items():
             if len(val) == 1:
                 pm[key] = val[0]

File docs/book/xml/apireference.xml

             non-WSGI settings (i.e., running under _cphttpserver), it is absent.</para>
         </section>
         <section>
-            <title>cherrypy.request.queryString</title>
+            <title>cherrypy.request.query_string</title>
             <para>This attribute is a string containing the query string of the request (the part of
             the URL following '?').</para>
         </section>
                 requestLine. The default Request processor calls this function.</para>
             </section>
             <section>
-                <title>parseQueryString(queryString, keep_blank_values=True)</title>
+                <title>parseQueryString(query_string, keep_blank_values=True)</title>
                 <para>Returns a dict of <code>{'key': 'value'}</code> pairs from an HTTP "key=value"
                 query string. Also handles server-side image map query strings. The default Request
                 processor calls this function.</para>
             response finalizing stage.</para>
         </section>
     </section>
-</section>
+</section>