|
OpenQuizz
Une application de gestion des contenus pédagogiques
|


Public Member Functions | |
| def | __init__ (self, argument_class=Argument, result_class=ParseResult, trim=False, bundle_errors=False) |
| def | add_argument (self, *args, **kwargs) |
| def | parse_args (self, req=None, strict=False) |
| def | copy (self) |
| def | replace_argument (self, name, *args, **kwargs) |
| def | remove_argument (self, name) |
| def | __schema__ (self) |
Data Fields | |
| args | |
| argument_class | |
| result_class | |
| trim | |
| bundle_errors | |
Enables adding and parsing of multiple arguments in the context of a single request.
Ex::
from flask_restplus import RequestParser
parser = RequestParser()
parser.add_argument('foo')
parser.add_argument('int_bar', type=int)
args = parser.parse_args()
:param bool trim: If enabled, trims whitespace on all arguments in this parser
:param bool bundle_errors: If enabled, do not abort when first error occurs,
return a dict with the name of the argument and the error message to be
bundled and return all validation errors
| def __init__ | ( | self, | |
argument_class = Argument, |
|||
result_class = ParseResult, |
|||
trim = False, |
|||
bundle_errors = False |
|||
| ) |
| def __schema__ | ( | self | ) |
| def add_argument | ( | self, | |
| * | args, | ||
| ** | kwargs | ||
| ) |
Adds an argument to be parsed. Accepts either a single instance of Argument or arguments to be passed into :class:`Argument`'s constructor. See :class:`Argument`'s constructor for documentation on the available options.
| def copy | ( | self | ) |
Creates a copy of this RequestParser with the same set of arguments
| def parse_args | ( | self, | |
req = None, |
|||
strict = False |
|||
| ) |
Parse all arguments from the provided request and return the results as a ParseResult :param bool strict: if req includes args not in parser, throw 400 BadRequest exception :return: the parsed results as :class:`ParseResult` (or any class defined as :attr:`result_class`) :rtype: ParseResult
| def remove_argument | ( | self, | |
| name | |||
| ) |
Remove the argument matching the given name.
| def replace_argument | ( | self, | |
| name, | |||
| * | args, | ||
| ** | kwargs | ||
| ) |
Replace the argument matching the given name with a new version.
| args |
| argument_class |
| bundle_errors |
| result_class |
| trim |