Ejemplo n.º 1
0
 def load_headers(self, req: Request, schema: Schema) -> MultiDictProxy:
     """Return headers from the request as a MultiDictProxy."""
     return MultiDictProxy(req.headers, schema)
Ejemplo n.º 2
0
 def load_files(self, req, schema):
     """Return files from the request as a MultiDictProxy."""
     return MultiDictProxy(req.files, schema)
Ejemplo n.º 3
0
 def load_querystring(self, req: Request, schema: Schema) -> MultiDictProxy:
     """Return query params from the request as a MultiDictProxy."""
     return MultiDictProxy(req.query_params, schema)
Ejemplo n.º 4
0
 def load_querystring(self, req, schema):
     """Return query params from the request as a MultiDictProxy."""
     return MultiDictProxy(req.args, schema)
Ejemplo n.º 5
0
 def load_form(self, req, schema):
     """Return form values from the request as a MultiDictProxy."""
     return MultiDictProxy(req.form, schema)
Ejemplo n.º 6
0
 def load_cookies(self, req, schema):
     """Return cookies from the request as a MultiDictProxy."""
     return MultiDictProxy(req.cookies, schema)
Ejemplo n.º 7
0
 def load_files(self, req, schema):
     """Return files from the request as a MultiDictProxy."""
     files = ((k, v) for k, v in req.POST.items() if hasattr(v, "file"))
     return MultiDictProxy(webob.multidict.MultiDict(files), schema)
Ejemplo n.º 8
0
 def load_form(self, req, schema):
     # remove immutability since we may want to modify the data in `schema_pre_load`
     return MultiDictProxy(_strip_whitespace(MultiDict(req.form)), schema)
 async def load_form(self, req: Request, schema: Schema) -> MultiDictProxy:
     """Return form values from the request as a MultiDictProxy."""
     post_data = await req.form()
     return MultiDictProxy(post_data, schema)
Ejemplo n.º 10
0
 def load_form(self, req, schema):
     return MultiDictProxy(req.form, schema)
Ejemplo n.º 11
0
 def load_view_args(self, req, schema):
     """Return the request's ``view_args`` or ``missing`` if there are none."""
     # pylint: disable=no-self-use
     return MultiDictProxy(req.match_info, schema) or core.missing
Ejemplo n.º 12
0
 async def load_form(self, req: Request, schema: Schema) -> MultiDictProxy:
     """Return form values from the request as a MultiDictProxy."""
     post_data = self._cache.get("post")
     if post_data is None:
         self._cache["post"] = await req.post()
     return MultiDictProxy(self._cache["post"], schema)
Ejemplo n.º 13
0
 def load_matchdict(self, req, schema):
     """Return the request's ``matchdict`` as a MultiDictProxy."""
     return MultiDictProxy(req.matchdict, schema)
Ejemplo n.º 14
0
 def load_querystring(self, req, schema):
     return MultiDictProxy(req.query, schema)