--- a/pyramid_cubicweb/core.py Thu Sep 18 11:43:45 2014 +0200
+++ b/pyramid_cubicweb/core.py Thu Sep 18 15:07:02 2014 +0200
@@ -1,5 +1,6 @@
from contextlib import contextmanager
from warnings import warn
+from cgi import FieldStorage
import rql
@@ -65,6 +66,29 @@
super(CubicWebPyramidRequest, self).__init__(vreg, https, post,
headers=headers_in)
+ self.content = request.body_file_seekable
+
+ def setup_params(self, params):
+ self.form = {}
+ for param, val in params.iteritems():
+ if param in self.no_script_form_params and val:
+ val = self.no_script_form_param(param, val)
+ if isinstance(val, FieldStorage) and val.file:
+ val = (val.filename, val.file)
+ if param == '_cwmsgid':
+ self.set_message_id(val)
+ elif param == '__message':
+ warn('[3.13] __message in request parameter is deprecated '
+ '(may only be given to .build_url). Seeing this message '
+ 'usualy means your application hold some <form> where '
+ 'you should replace use of __message hidden input by '
+ 'form.set_message, so new _cwmsgid mechanism is properly '
+ 'used',
+ DeprecationWarning)
+ self.set_message(val)
+ else:
+ self.form[param] = val
+
def is_secure(self):
return self._request.scheme == 'https'