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

Public Member Functions

def __init__ (self, field)
 
def __call__ (self, f)
 

Data Fields

 field
 

Detailed Description

A decorator that formats the return values of your methods with a single field.

>>> from flask_restx import marshal_with_field, fields
>>> @marshal_with_field(fields.List(fields.Integer))
... def get():
...     return ['1', 2, 3.0]
...
>>> get()
[1, 2, 3]

see :meth:`flask_restx.marshal_with`

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  field 
)
:param field: a single field with which to marshal the output.

Member Function Documentation

◆ __call__()

def __call__ (   self,
  f 
)

Field Documentation

◆ field

field

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