Ticket #5682: patch_django_5682_modpython.diff
File patch_django_5682_modpython.diff, 2.5 KB (added by , 17 years ago) |
---|
-
django/core/handlers/modpython.py
28 28 except: 29 29 post = '<could not parse>' 30 30 try: 31 put = pformat(self.PUT) 32 except: 33 put = '<could not parse>' 34 try: 31 35 cookies = pformat(self.COOKIES) 32 36 except: 33 37 cookies = '<could not parse>' … … 35 39 meta = pformat(self.META) 36 40 except: 37 41 meta = '<could not parse>' 38 return '<ModPythonRequest\npath:%s,\nGET:%s,\nPOST:%s,\n COOKIES:%s,\nMETA:%s>' % \39 (self.path, get, post, cookies, meta)42 return '<ModPythonRequest\npath:%s,\nGET:%s,\nPOST:%s,\nPUT:%s,\nCOOKIES:%s,\nMETA:%s>' % \ 43 (self.path, get, post, put, cookies, meta) 40 44 41 45 def get_full_path(self): 42 46 return '%s%s' % (self.path, self._req.args and ('?' + self._req.args) or '') … … 51 55 def _load_post_and_files(self): 52 56 "Populates self._post and self._files" 53 57 if 'content-type' in self._req.headers_in and self._req.headers_in['content-type'].startswith('multipart'): 54 self._p ost, self._files = http.parse_file_upload(self._req.headers_in, self.raw_post_data)58 self._put, self._post, self._files = http.parse_file_upload(self._req.headers_in, self.raw_post_data) 55 59 else: 56 self._p ost, self._files = http.QueryDict(self.raw_post_data, encoding=self._encoding), datastructures.MultiValueDict()60 self._put, self._post, self._files = http.QueryDict(self.raw_post_data, encoding=self._encoding), datastructures.MultiValueDict() 57 61 58 62 def _get_request(self): 59 63 if not hasattr(self, '_request'): … … 76 80 def _set_post(self, post): 77 81 self._post = post 78 82 83 def _get_put(self): 84 if not hasattr(self, '_put'): 85 self._load_post_and_files() 86 self._put = self._post 87 return self._put 88 89 def _set_put(self, put): 90 self._put = put 91 79 92 def _get_cookies(self): 80 93 if not hasattr(self, '_cookies'): 81 94 self._cookies = http.parse_cookie(self._req.headers_in.get('cookie', '')) … … 128 141 129 142 GET = property(_get_get, _set_get) 130 143 POST = property(_get_post, _set_post) 144 PUT = property(_get_put, _set_put) 131 145 COOKIES = property(_get_cookies, _set_cookies) 132 146 FILES = property(_get_files) 133 147 META = property(_get_meta)