visiomode.webpanel.api.DeviceAPI

class visiomode.webpanel.api.DeviceAPI

Bases: MethodView

__init__()

Methods

__init__()

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.

post()

Attributes

decorators

The canonical way to decorate class-based views is to decorate the return value of as_view().

methods

A list of methods this view can handle.

provide_automatic_options

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

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: Any, **kwargs: Any) Union[Response, AnyStr, Dict[str, Any], Generator[AnyStr, None, None], Tuple[Union[Response, AnyStr, Dict[str, Any], Generator[AnyStr, None, None]], Union[Headers, Dict[str, Union[str, List[str], Tuple[str, ...]]], List[Tuple[str, Union[str, List[str], Tuple[str, ...]]]]]], Tuple[Union[Response, AnyStr, Dict[str, Any], Generator[AnyStr, None, None]], int], Tuple[Union[Response, AnyStr, Dict[str, Any], Generator[AnyStr, None, None]], int, Union[Headers, Dict[str, Union[str, List[str], Tuple[str, ...]]], List[Tuple[str, Union[str, List[str], Tuple[str, ...]]]]]], WSGIApplication]

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]] = {'POST'}

A list of methods this view can handle.

provide_automatic_options: Optional[bool] = None

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