mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 04:54:48 +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.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseBase
|
||||
from django.http.response import HttpResponse
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
class SessionMiddleware(MiddlewareMixin):
|
||||
get_response: Callable[[WSGIRequest], HttpResponseBase] = ...
|
||||
SessionStore: Type[SessionBase] = ...
|
||||
def __init__(self, get_response: Optional[Callable] = ...) -> 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 django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseBase
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
|
||||
class RemovedInDjango30Warning(PendingDeprecationWarning): ...
|
||||
class RemovedInNextVersionWarning(DeprecationWarning): ...
|
||||
@@ -22,10 +22,10 @@ class RenameMethodsBase(type):
|
||||
|
||||
class DeprecationInstanceCheck(type):
|
||||
alternative: str
|
||||
deprecation_warning: Type[django.utils.deprecation.RemovedInNextVersionWarning]
|
||||
deprecation_warning: Type[Warning]
|
||||
def __instancecheck__(self, instance: Any): ...
|
||||
|
||||
class MiddlewareMixin:
|
||||
get_response: Any = ...
|
||||
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
||||
def __call__(self, request: HttpRequest) -> HttpResponseBase: ...
|
||||
get_response: Callable[[WSGIRequest], HttpResponse] = ...
|
||||
def __init__(self, get_response: Optional[Callable[[WSGIRequest], HttpResponse]] = ...) -> None: ...
|
||||
def __call__(self, request: WSGIRequest) -> HttpResponse: ...
|
||||
|
||||
Reference in New Issue
Block a user