whiteapp.WhiteApp

WhiteApp application

Classes

Namespace(name[, description, path, ...])

Group resources together.

Resource([api])

Represents an abstract RESTX resource.

Version([api])

Flask resource to spit current version

class whiteapp.WhiteApp.Version(api=None, *args, **kwargs)[source]

Bases: Resource

Flask resource to spit current version

Attributes:
provide_automatic_options
representations

Methods

as_view(name, *class_args, **class_kwargs)

Converts the class into an actual view function that can be used with the routing system.

dispatch_request(*args, **kwargs)

Subclasses have to override this method to implement the actual view function code.

validate_payload(func)

Perform a payload validation on expected model if necessary

get

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.

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.

validate_payload(func)

Perform a payload validation on expected model if necessary