Changeset 766
- Timestamp:
- 10/31/05 12:19:37
- Files:
-
- branches/cherrypy-2.1/cherrypy/_cperror.py (modified) (3 diffs)
- trunk/cherrypy/_cperror.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/cherrypy-2.1/cherrypy/_cperror.py
r710 r766 66 66 import cherrypy 67 67 import cgi 68 request = cherrypy.request 68 69 69 70 # Set a 'path' member attribute so that code which traps this … … 73 74 if params is not None: 74 75 if isinstance(params, basestring): 75 cherrypy.request.queryString = params76 request.queryString = params 76 77 pm = cgi.parse_qs(params, keep_blank_values=True) 77 78 for key, val in pm.items(): 78 79 if len(val) == 1: 79 80 pm[key] = val[0] 80 cherrypy.request.paramMap = pm81 request.paramMap = pm 81 82 else: 82 cherrypy.request.queryString = urllib.urlencode(params) 83 cherrypy.request.paramMap = params.copy() 84 85 cherrypy.request.browserUrl = cherrypy.request.base + path 83 request.queryString = urllib.urlencode(params) 84 request.paramMap = params.copy() 85 86 request.browserUrl = request.base + path 87 if request.queryString: 88 request.browserUrl += '?' + request.queryString 86 89 87 90 … … 109 112 # 2. a URL relative to root (e.g. "/dummy") 110 113 # 3. a URL relative to the current path 114 # Note that any querystring in browserUrl will be discarded. 111 115 url = urlparse.urljoin(cherrypy.request.browserUrl, url) 112 116 abs_urls.append(url) trunk/cherrypy/_cperror.py
r762 r766 66 66 import cherrypy 67 67 import cgi 68 request = cherrypy.request 68 69 69 70 # Set a 'path' member attribute so that code which traps this … … 73 74 if params is not None: 74 75 if isinstance(params, basestring): 75 cherrypy.request.queryString = params76 request.queryString = params 76 77 pm = cgi.parse_qs(params, keep_blank_values=True) 77 78 for key, val in pm.items(): 78 79 if len(val) == 1: 79 80 pm[key] = val[0] 80 cherrypy.request.paramMap = pm81 request.paramMap = pm 81 82 else: 82 cherrypy.request.queryString = urllib.urlencode(params) 83 cherrypy.request.paramMap = params.copy() 84 85 cherrypy.request.browserUrl = cherrypy.request.base + path 83 request.queryString = urllib.urlencode(params) 84 request.paramMap = params.copy() 85 86 request.browserUrl = request.base + path 87 if request.queryString: 88 request.browserUrl += '?' + request.queryString 86 89 87 90 … … 109 112 # 2. a URL relative to root (e.g. "/dummy") 110 113 # 3. a URL relative to the current path 114 # Note that any querystring in browserUrl will be discarded. 111 115 url = urlparse.urljoin(cherrypy.request.browserUrl, url) 112 116 abs_urls.append(url)

