mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-16 00:37:11 +08:00
reformat with black
This commit is contained in:
@@ -7,6 +7,7 @@ from typing import Any, Optional
|
||||
from datetime import datetime, timedelta
|
||||
from django.db.models.base import Model
|
||||
from typing import Dict, Optional, Union
|
||||
|
||||
VALID_KEY_CHARS: Any
|
||||
|
||||
class CreateError(Exception): ...
|
||||
@@ -25,7 +26,9 @@ class SessionBase:
|
||||
def __getitem__(self, key: str) -> Union[str, Model, int]: ...
|
||||
def __setitem__(self, key: str, value: Union[str, datetime, int]) -> None: ...
|
||||
def __delitem__(self, key: str) -> None: ...
|
||||
def get(self, key: str, default: Optional[str] = ...) -> Optional[Union[str, datetime, int]]: ...
|
||||
def get(
|
||||
self, key: str, default: Optional[str] = ...
|
||||
) -> Optional[Union[str, datetime, int]]: ...
|
||||
def pop(self, key: str, default: object = ...) -> Union[str, int]: ...
|
||||
def setdefault(self, key: str, value: str) -> str: ...
|
||||
def set_test_cookie(self) -> None: ...
|
||||
@@ -49,7 +52,9 @@ class SessionBase:
|
||||
__session_key: Any = ...
|
||||
def _set_session_key(self, value: Optional[str]) -> None: ...
|
||||
session_key: Any = ...
|
||||
def _get_session(self, no_load: bool = ...) -> Dict[str, Union[str, int, datetime, Model]]: ...
|
||||
def _get_session(
|
||||
self, no_load: bool = ...
|
||||
) -> Dict[str, Union[str, int, datetime, Model]]: ...
|
||||
_session: Any = ...
|
||||
def get_expiry_age(self, **kwargs: Any) -> int: ...
|
||||
def get_expiry_date(self, **kwargs: Any) -> datetime: ...
|
||||
|
||||
@@ -6,6 +6,7 @@ from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
KEY_PREFIX: str
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
|
||||
@@ -6,6 +6,7 @@ from django.contrib.sessions.backends.db import SessionStore as DBStore
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
KEY_PREFIX: str
|
||||
|
||||
class SessionStore(DBStore):
|
||||
|
||||
@@ -9,6 +9,7 @@ from datetime import datetime
|
||||
from django.contrib.sessions.base_session import AbstractBaseSession
|
||||
from django.contrib.sessions.models import Session
|
||||
from typing import Dict, Optional, Type, Union
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@classmethod
|
||||
@@ -20,7 +21,9 @@ class SessionStore(SessionBase):
|
||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||
modified: bool = ...
|
||||
def create(self) -> None: ...
|
||||
def create_model_instance(self, data: Dict[str, Union[str, int, datetime]]) -> AbstractBaseSession: ...
|
||||
def create_model_instance(
|
||||
self, data: Dict[str, Union[str, int, datetime]]
|
||||
) -> AbstractBaseSession: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@classmethod
|
||||
|
||||
@@ -6,6 +6,7 @@ from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Dict, Optional
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
storage_path: Any = ...
|
||||
file_prefix: Any = ...
|
||||
|
||||
@@ -7,6 +7,7 @@ from typing import Any, Optional
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Dict, Optional, Union
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
def load(self) -> Dict[str, Union[str, datetime]]: ...
|
||||
modified: bool = ...
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from typing import Dict
|
||||
|
||||
|
||||
class AbstractBaseSession:
|
||||
def __str__(self) -> str: ...
|
||||
def get_decoded(self) -> Dict[str, int]: ...
|
||||
def get_decoded(self) -> Dict[str, int]: ...
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
class Command:
|
||||
def handle(self, **options) -> None: ...
|
||||
def handle(self, **options) -> None: ...
|
||||
|
||||
@@ -8,9 +8,12 @@ from typing import Any, Optional
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponseBase
|
||||
from typing import Callable, Optional
|
||||
|
||||
class SessionMiddleware(MiddlewareMixin):
|
||||
get_response: Any = ...
|
||||
SessionStore: Any = ...
|
||||
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
||||
def process_request(self, request: WSGIRequest) -> None: ...
|
||||
def process_response(self, request: WSGIRequest, response: HttpResponseBase) -> HttpResponseBase: ...
|
||||
def process_response(
|
||||
self, request: WSGIRequest, response: HttpResponseBase
|
||||
) -> HttpResponseBase: ...
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from django.contrib.sessions.backends.db import SessionStore
|
||||
from typing import Type
|
||||
|
||||
|
||||
class Session:
|
||||
@classmethod
|
||||
def get_session_store_class(cls) -> Type[SessionStore]: ...
|
||||
def get_session_store_class(cls) -> Type[SessionStore]: ...
|
||||
|
||||
@@ -8,7 +8,9 @@ from typing import Any
|
||||
from datetime import datetime
|
||||
from django.db.models.base import Model
|
||||
from typing import Dict, Union
|
||||
|
||||
class PickleSerializer:
|
||||
def dumps(self, obj: Dict[str, Union[str, datetime]]) -> bytes: ...
|
||||
def loads(self, data: bytes) -> Dict[str, Model]: ...
|
||||
|
||||
JSONSerializer = BaseJSONSerializer
|
||||
|
||||
Reference in New Issue
Block a user