flask_restful_dbbase.doc_utils.MethodDoc

class flask_restful_dbbase.doc_utils.MethodDoc(method, input=None, input_modifier=None, before_commit=None, after_commit=None, use_default_response=True, responses=None)[source]

Bases: object

This class holds details about a method.

Parameters:
  • method – (str) : The method name

  • input – (str) : Optional input if necessary, otherwise default

  • input_modifier – (str) : Optional input of process_{method}_inputs

  • before_commit – (str) : Optional before_commit description

  • after_commit – (str) : Optional after_commit description

  • use_default_response – (bool) : A flag to overwrite responses

  • responses – (list) : A list of possible custom responses

__init__(method, input=None, input_modifier=None, before_commit=None, after_commit=None, use_default_response=True, responses=None)[source]

Methods

__init__(method[, input, input_modifier, ...])

get_default_response(meta_doc)

This function returns the standard response for the method.

get_method_decorators(meta_doc)

This function returns a string representation of any method decorators.

to_dict(meta_doc)

Convert attributes to a dictionary

to_dict(meta_doc)[source]

Convert attributes to a dictionary

get_method_decorators(meta_doc)[source]

This function returns a string representation of any method decorators.

Parameters:

meta_doc – (obj) : The meta document being processed.

Returns:

(list – None) : The string list of method decorator names.

get_default_response(meta_doc)[source]

This function returns the standard response for the method. If something special is done, then the default response would be supressed.