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

Public Member Functions

def __init__ (self, stream_factory=None, charset="utf-8", errors="replace", max_form_memory_size=None, max_content_length=None, cls=None, silent=True)
 
def get_parse_func (self, mimetype, options)
 
def parse_from_environ (self, environ)
 
def parse (self, stream, mimetype, content_length, options=None)
 

Data Fields

 stream_factory
 
 charset
 
 errors
 
 max_form_memory_size
 
 max_content_length
 
 cls
 
 silent
 

Static Public Attributes

 parse_functions
 

Detailed Description

This class implements parsing of form data for Werkzeug.  By itself
it can parse multipart and url encoded form data.  It can be subclassed
and extended but for most mimetypes it is a better idea to use the
untouched stream and expose it as separate attributes on a request
object.

.. versionadded:: 0.8

:param stream_factory: An optional callable that returns a new read and
                       writeable file descriptor.  This callable works
                       the same as :meth:`~BaseResponse._get_file_stream`.
:param charset: The character set for URL and url encoded form data.
:param errors: The encoding error behavior.
:param max_form_memory_size: the maximum number of bytes to be accepted for
                       in-memory stored form data.  If the data
                       exceeds the value specified an
                       :exc:`~exceptions.RequestEntityTooLarge`
                       exception is raised.
:param max_content_length: If this is provided and the transmitted data
                           is longer than this value an
                           :exc:`~exceptions.RequestEntityTooLarge`
                           exception is raised.
:param cls: an optional dict class to use.  If this is not specified
                   or `None` the default :class:`MultiDict` is used.
:param silent: If set to False parsing errors will not be caught.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  stream_factory = None,
  charset = "utf-8",
  errors = "replace",
  max_form_memory_size = None,
  max_content_length = None,
  cls = None,
  silent = True 
)

Member Function Documentation

◆ get_parse_func()

def get_parse_func (   self,
  mimetype,
  options 
)

◆ parse()

def parse (   self,
  stream,
  mimetype,
  content_length,
  options = None 
)
Parses the information from the given stream, mimetype,
content length and mimetype parameters.

:param stream: an input stream
:param mimetype: the mimetype of the data
:param content_length: the content length of the incoming data
:param options: optional mimetype parameters (used for
        the multipart boundary for instance)
:return: A tuple in the form ``(stream, form, files)``.

◆ parse_from_environ()

def parse_from_environ (   self,
  environ 
)
Parses the information from the environment as form data.

:param environ: the WSGI environment to be used for parsing.
:return: A tuple in the form ``(stream, form, files)``.

Field Documentation

◆ charset

charset

◆ cls

cls

◆ errors

errors

◆ max_content_length

max_content_length

◆ max_form_memory_size

max_form_memory_size

◆ parse_functions

parse_functions
static

◆ silent

silent

◆ stream_factory

stream_factory

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