mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 21:46:43 +08:00
session middleware fixes
This commit is contained in:
@@ -1,14 +1,12 @@
|
|||||||
from typing import Callable, Optional, Type
|
from typing import Type
|
||||||
|
|
||||||
from django.contrib.sessions.backends.base import SessionBase
|
from django.contrib.sessions.backends.base import SessionBase
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
from django.http.response import HttpResponseBase
|
from django.http.response import HttpResponse
|
||||||
from django.utils.deprecation import MiddlewareMixin
|
from django.utils.deprecation import MiddlewareMixin
|
||||||
|
|
||||||
class SessionMiddleware(MiddlewareMixin):
|
class SessionMiddleware(MiddlewareMixin):
|
||||||
get_response: Callable[[WSGIRequest], HttpResponseBase] = ...
|
|
||||||
SessionStore: Type[SessionBase] = ...
|
SessionStore: Type[SessionBase] = ...
|
||||||
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
|
||||||
def process_request(self, request: HttpRequest) -> None: ...
|
def process_request(self, request: HttpRequest) -> None: ...
|
||||||
def process_response(self, request: WSGIRequest, response: HttpResponseBase) -> HttpResponseBase: ...
|
def process_response(self, request: WSGIRequest, response: HttpResponse) -> HttpResponse: ...
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from typing import Any, Callable, Optional, Type
|
from typing import Any, Callable, Optional, Type
|
||||||
|
|
||||||
from django.http.request import HttpRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.http.response import HttpResponseBase
|
from django.http.response import HttpResponse
|
||||||
|
|
||||||
class RemovedInDjango30Warning(PendingDeprecationWarning): ...
|
class RemovedInDjango30Warning(PendingDeprecationWarning): ...
|
||||||
class RemovedInNextVersionWarning(DeprecationWarning): ...
|
class RemovedInNextVersionWarning(DeprecationWarning): ...
|
||||||
@@ -22,10 +22,10 @@ class RenameMethodsBase(type):
|
|||||||
|
|
||||||
class DeprecationInstanceCheck(type):
|
class DeprecationInstanceCheck(type):
|
||||||
alternative: str
|
alternative: str
|
||||||
deprecation_warning: Type[django.utils.deprecation.RemovedInNextVersionWarning]
|
deprecation_warning: Type[Warning]
|
||||||
def __instancecheck__(self, instance: Any): ...
|
def __instancecheck__(self, instance: Any): ...
|
||||||
|
|
||||||
class MiddlewareMixin:
|
class MiddlewareMixin:
|
||||||
get_response: Any = ...
|
get_response: Callable[[WSGIRequest], HttpResponse] = ...
|
||||||
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
def __init__(self, get_response: Optional[Callable[[WSGIRequest], HttpResponse]] = ...) -> None: ...
|
||||||
def __call__(self, request: HttpRequest) -> HttpResponseBase: ...
|
def __call__(self, request: WSGIRequest) -> HttpResponse: ...
|
||||||
|
|||||||
Reference in New Issue
Block a user