2016-12-28 18:37:28 +01:00
|
|
|
# This mypy stubs file ensures that mypy can correctly analyze REQ.
|
2016-07-22 15:10:19 +02:00
|
|
|
from typing import Any, Callable, TypeVar
|
|
|
|
from django.http import HttpResponse
|
|
|
|
|
|
|
|
ViewFuncT = TypeVar('ViewFuncT', bound=Callable[..., HttpResponse])
|
2016-05-30 16:40:59 +02:00
|
|
|
|
|
|
|
class JsonableError(Exception):
|
|
|
|
error = ... # type: Any
|
|
|
|
def to_json_error_msg(self) -> Any: ...
|
|
|
|
|
|
|
|
class RequestVariableMissingError(JsonableError): ...
|
2016-12-28 18:37:28 +01:00
|
|
|
class RequestVariableConversionError(JsonableError): ...
|
2016-05-30 16:40:59 +02:00
|
|
|
|
|
|
|
def REQ(*args: Any, **kwargs: Any) -> Any: ...
|
|
|
|
|
2016-07-22 15:10:19 +02:00
|
|
|
def has_request_variables(view_func: ViewFuncT) -> ViewFuncT: ...
|