OpenQuizz
Une application de gestion des contenus pédagogiques
PyramidParser Class Reference
Inheritance diagram for PyramidParser:
Collaboration diagram for PyramidParser:

Public Member Functions

def load_querystring (self, req, schema)
 
def load_form (self, req, schema)
 
def load_cookies (self, req, schema)
 
def load_headers (self, req, schema)
 
def load_files (self, req, schema)
 
def load_matchdict (self, req, schema)
 
def handle_error (self, error, req, schema, *error_status_code, error_headers)
 
def use_args (self, argmap, req=None, *location=core.Parser.DEFAULT_LOCATION, unknown=None, as_kwargs=False, validate=None, error_status_code=None, error_headers=None)
 
- Public Member Functions inherited from Parser
def __init__ (self, typing.Optional[str] location=None, *typing.Optional[str] unknown=_UNKNOWN_DEFAULT_PARAM, typing.Optional[ErrorHandler] error_handler=None, typing.Optional[typing.Type] schema_class=None)
 
def parse (self, ArgMap argmap, typing.Optional[Request] req=None, *typing.Optional[str] location=None, typing.Optional[str] unknown=_UNKNOWN_DEFAULT_PARAM, ValidateArg validate=None, typing.Optional[int] error_status_code=None, typing.Optional[typing.Mapping[str, str]] error_headers=None)
 
typing.Optional[Requestget_default_request (self)
 
typing.Optional[Requestget_request_from_view_args (self, typing.Callable view, typing.Tuple args, typing.Mapping[str, typing.Any] kwargs)
 
typing.Callable[..., typing.Callable] use_args (self, ArgMap argmap, typing.Optional[Request] req=None, *typing.Optional[str] location=None, typing.Optional[str] unknown=_UNKNOWN_DEFAULT_PARAM, bool as_kwargs=False, ValidateArg validate=None, typing.Optional[int] error_status_code=None, typing.Optional[typing.Mapping[str, str]] error_headers=None)
 
typing.Callable use_kwargs (self, *args, **kwargs)
 
def location_loader (self, str name)
 
ErrorHandler error_handler (self, ErrorHandler func)
 
Mapping pre_load (self, Mapping location_data, *ma.Schema schema, Request req, str location)
 
typing.Any load_json (self, Request req, ma.Schema schema)
 
def load_json_or_form (self, Request req, ma.Schema schema)
 
def load_querystring (self, Request req, ma.Schema schema)
 
def load_form (self, Request req, ma.Schema schema)
 
def load_headers (self, Request req, ma.Schema schema)
 
def load_cookies (self, Request req, ma.Schema schema)
 
def load_files (self, Request req, ma.Schema schema)
 
typing.NoReturn handle_error (self, ValidationError error, Request req, ma.Schema schema, *int error_status_code, typing.Mapping[str, str] error_headers)
 

Static Public Attributes

 matchdict
 
 path
 
- Static Public Attributes inherited from Parser
 str
 
 Type
 
 int
 

Additional Inherited Members

- Data Fields inherited from Parser
 location
 
 schema_class
 
 unknown
 
 error_callback
 

Detailed Description

Pyramid request argument parser.

Member Function Documentation

◆ handle_error()

def handle_error (   self,
  error,
  req,
  schema,
error_status_code,
  error_headers 
)
Handles errors during parsing. Aborts the current HTTP request and
responds with a 400 error.

◆ load_cookies()

def load_cookies (   self,
  req,
  schema 
)
Return cookies from the request as a MultiDictProxy.

◆ load_files()

def load_files (   self,
  req,
  schema 
)
Return files from the request as a MultiDictProxy.

◆ load_form()

def load_form (   self,
  req,
  schema 
)
Return form values from the request as a MultiDictProxy.

◆ load_headers()

def load_headers (   self,
  req,
  schema 
)
Return headers from the request as a MultiDictProxy.

◆ load_matchdict()

def load_matchdict (   self,
  req,
  schema 
)
Return the request's ``matchdict`` as a MultiDictProxy.

◆ load_querystring()

def load_querystring (   self,
  req,
  schema 
)
Return query params from the request as a MultiDictProxy.

◆ use_args()

def use_args (   self,
  argmap,
  req = None,
location = core.Parser.DEFAULT_LOCATION,
  unknown = None,
  as_kwargs = False,
  validate = None,
  error_status_code = None,
  error_headers = None 
)
Decorator that injects parsed arguments into a view callable.
Supports the *Class-based View* pattern where `request` is saved as an instance
attribute on a view class.

:param dict argmap: Either a `marshmallow.Schema`, a `dict`
    of argname -> `marshmallow.fields.Field` pairs, or a callable
    which accepts a request and returns a `marshmallow.Schema`.
:param req: The request object to parse. Pulled off of the view by default.
:param str location: Where on the request to load values.
:param str unknown: A value to pass for ``unknown`` when calling the
    schema's ``load`` method.
:param bool as_kwargs: Whether to insert arguments as keyword arguments.
:param callable validate: Validation function that receives the dictionary
    of parsed arguments. If the function returns ``False``, the parser
    will raise a :exc:`ValidationError`.
:param int error_status_code: Status code passed to error handler functions when
    a `ValidationError` is raised.
:param dict error_headers: Headers passed to error handler functions when a
    a `ValidationError` is raised.

Field Documentation

◆ matchdict

matchdict
static

◆ path

path
static

The documentation for this class was generated from the following file: