app.blueprints.base

Description

Classes

BaseResource([api])

WelcomeResource([api])

class app.blueprints.base.BaseResource(api=None, *args, **kwargs)
classmethod as_view(name: str, *class_args: Any, **class_kwargs: Any) Callable

Converts the class into an actual view function that can be used with the routing system. Internally this generates a function on the fly which will instantiate the View on each request and call the dispatch_request() method on it.

The arguments passed to as_view() are forwarded to the constructor of the class.

decorators: List[Callable] = []

The canonical way to decorate class-based views is to decorate the return value of as_view(). However since this moves parts of the logic from the class declaration to the place where it’s hooked into the routing system.

You can place one or more decorators in this list and whenever the view function is created the result is automatically decorated.

New in version 0.8.

dispatch_request(*args, **kwargs)

Subclasses have to override this method to implement the actual view function code. This method is called with all the arguments from the URL rule.

method_decorators = []
methods: Optional[List[str]] = None

A list of methods this view can handle.

provide_automatic_options: Optional[bool] = None

Setting this disables or force-enables the automatic options handling.

representations = None
validate_payload(func)

Perform a payload validation on expected model if necessary

class app.blueprints.base.WelcomeResource(api=None, *args, **kwargs)
classmethod as_view(name: str, *class_args: Any, **class_kwargs: Any) Callable

Converts the class into an actual view function that can be used with the routing system. Internally this generates a function on the fly which will instantiate the View on each request and call the dispatch_request() method on it.

The arguments passed to as_view() are forwarded to the constructor of the class.

decorators: List[Callable] = []

The canonical way to decorate class-based views is to decorate the return value of as_view(). However since this moves parts of the logic from the class declaration to the place where it’s hooked into the routing system.

You can place one or more decorators in this list and whenever the view function is created the result is automatically decorated.

New in version 0.8.

dispatch_request(*args, **kwargs)

Subclasses have to override this method to implement the actual view function code. This method is called with all the arguments from the URL rule.

get() tuple
method_decorators = []
methods: Optional[List[str]] = {'GET'}

A list of methods this view can handle.

provide_automatic_options: Optional[bool] = None

Setting this disables or force-enables the automatic options handling.

representations = None
validate_payload(func)

Perform a payload validation on expected model if necessary