mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-22 03:41:28 +08:00
merge with stubgen output
This commit is contained in:
@@ -1,43 +1,66 @@
|
||||
from datetime import (
|
||||
datetime,
|
||||
timedelta,
|
||||
)
|
||||
from django.db.models.base import Model
|
||||
from typing import (
|
||||
Dict,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
# Stubs for django.contrib.sessions.backends.base (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
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): ...
|
||||
class UpdateError(Exception): ...
|
||||
|
||||
class SessionBase:
|
||||
def __contains__(self, key: str) -> bool: ...
|
||||
def __delitem__(self, key: str) -> None: ...
|
||||
def __getitem__(self, key: str) -> Union[str, Model, int]: ...
|
||||
TEST_COOKIE_NAME: str = ...
|
||||
TEST_COOKIE_VALUE: str = ...
|
||||
__not_given: Any = ...
|
||||
_session_key: Any = ...
|
||||
accessed: bool = ...
|
||||
modified: bool = ...
|
||||
serializer: Any = ...
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def __contains__(self, key: str) -> bool: ...
|
||||
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 pop(self, key: str, default: object = ...) -> Union[str, int]: ...
|
||||
def setdefault(self, key: str, value: str) -> str: ...
|
||||
def set_test_cookie(self) -> None: ...
|
||||
def test_cookie_worked(self) -> bool: ...
|
||||
def delete_test_cookie(self) -> None: ...
|
||||
def _hash(self, value: bytes) -> str: ...
|
||||
def encode(self, session_dict: Dict[str, Union[str, int, datetime]]) -> str: ...
|
||||
def decode(self, session_data: Union[str, bytes]) -> Dict[str, Union[str, int]]: ...
|
||||
def update(self, dict_: Dict[str, int]) -> None: ...
|
||||
def has_key(self, key: Any): ...
|
||||
def keys(self): ...
|
||||
def values(self): ...
|
||||
def items(self): ...
|
||||
_session_cache: Any = ...
|
||||
def clear(self) -> None: ...
|
||||
def is_empty(self) -> bool: ...
|
||||
def _get_new_session_key(self) -> str: ...
|
||||
def _get_or_create_session_key(self) -> str: ...
|
||||
def _get_session(
|
||||
self,
|
||||
no_load: bool = ...
|
||||
) -> Dict[str, Union[str, int, datetime, Model]]: ...
|
||||
def _get_session_key(self) -> Optional[str]: ...
|
||||
def _hash(self, value: bytes) -> str: ...
|
||||
def _set_session_key(self, value: Optional[str]) -> None: ...
|
||||
def _validate_session_key(self, key: Optional[str]) -> Optional[Union[str, bool]]: ...
|
||||
def clear(self) -> None: ...
|
||||
def cycle_key(self) -> None: ...
|
||||
def decode(self, session_data: Union[str, bytes]) -> Dict[str, Union[str, int]]: ...
|
||||
def encode(self, session_dict: Dict[str, Union[str, int, datetime]]) -> str: ...
|
||||
def flush(self) -> None: ...
|
||||
def get(self, key: str, default: Optional[str] = ...) -> Optional[Union[str, datetime, int]]: ...
|
||||
def get_expire_at_browser_close(self) -> bool: ...
|
||||
def get_expiry_age(self, **kwargs) -> int: ...
|
||||
def get_expiry_date(self, **kwargs) -> datetime: ...
|
||||
def is_empty(self) -> bool: ...
|
||||
def pop(self, key: str, default: object = ...) -> Union[str, int]: ...
|
||||
def _get_session_key(self) -> Optional[str]: ...
|
||||
__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]]: ...
|
||||
_session: Any = ...
|
||||
def get_expiry_age(self, **kwargs: Any) -> int: ...
|
||||
def get_expiry_date(self, **kwargs: Any) -> datetime: ...
|
||||
def set_expiry(self, value: Optional[Union[datetime, int, timedelta]]) -> None: ...
|
||||
def setdefault(self, key: str, value: str) -> str: ...
|
||||
def test_cookie_worked(self) -> bool: ...
|
||||
def update(self, dict_: Dict[str, int]) -> None: ...
|
||||
def get_expire_at_browser_close(self) -> bool: ...
|
||||
def flush(self) -> None: ...
|
||||
def cycle_key(self) -> None: ...
|
||||
def exists(self, session_key: Any) -> None: ...
|
||||
def create(self) -> None: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
def delete(self, session_key: Optional[Any] = ...) -> None: ...
|
||||
def load(self) -> None: ...
|
||||
@classmethod
|
||||
def clear_expired(cls) -> None: ...
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Optional,
|
||||
)
|
||||
# Stubs for django.contrib.sessions.backends.cache (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
class SessionStore:
|
||||
from typing import Any, Dict, Optional
|
||||
KEY_PREFIX: str
|
||||
|
||||
class SessionStore(SessionBase):
|
||||
cache_key_prefix: Any = ...
|
||||
_cache: Any = ...
|
||||
def __init__(self, session_key: None = ...) -> None: ...
|
||||
@property
|
||||
def cache_key(self) -> str: ...
|
||||
def create(self) -> None: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||
_session_key: Any = ...
|
||||
def load(self) -> Dict[Any, Any]: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
modified: bool = ...
|
||||
def create(self) -> None: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@classmethod
|
||||
def clear_expired(cls) -> None: ...
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Optional,
|
||||
)
|
||||
# Stubs for django.contrib.sessions.backends.cached_db (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.contrib.sessions.backends.db import SessionStore as DBStore
|
||||
from typing import Any, Optional
|
||||
|
||||
class SessionStore:
|
||||
from typing import Any, Dict, Optional
|
||||
KEY_PREFIX: str
|
||||
|
||||
class SessionStore(DBStore):
|
||||
cache_key_prefix: Any = ...
|
||||
_cache: Any = ...
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@property
|
||||
def cache_key(self) -> str: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def exists(self, session_key: str) -> bool: ...
|
||||
def flush(self) -> None: ...
|
||||
def load(self) -> Dict[Any, Any]: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
def exists(self, session_key: str) -> bool: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
_session_key: Any = ...
|
||||
def flush(self) -> None: ...
|
||||
|
||||
@@ -1,29 +1,27 @@
|
||||
# Stubs for django.contrib.sessions.backends.db (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
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:
|
||||
from typing import Dict, Optional, Type, Union
|
||||
class SessionStore(SessionBase):
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def _get_session_from_db(self) -> Optional[AbstractBaseSession]: ...
|
||||
@classmethod
|
||||
def clear_expired(cls) -> None: ...
|
||||
def create(self) -> None: ...
|
||||
def create_model_instance(
|
||||
self,
|
||||
data: Dict[str, Union[str, int, datetime]]
|
||||
) -> AbstractBaseSession: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||
@classmethod
|
||||
def get_model_class(cls) -> Type[Session]: ...
|
||||
def load(self) -> Dict[str, Union[str, int]]: ...
|
||||
@cached_property
|
||||
def model(self) -> Type[AbstractBaseSession]: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
_session_key: Any = ...
|
||||
def _get_session_from_db(self) -> Optional[AbstractBaseSession]: ...
|
||||
def load(self) -> Dict[str, Union[str, int]]: ...
|
||||
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 save(self, must_create: bool = ...) -> None: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@classmethod
|
||||
def clear_expired(cls) -> None: ...
|
||||
|
||||
@@ -1,18 +1,27 @@
|
||||
from typing import (
|
||||
Dict,
|
||||
Optional,
|
||||
)
|
||||
# Stubs for django.contrib.sessions.backends.file (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
class SessionStore:
|
||||
from typing import Dict, Optional
|
||||
class SessionStore(SessionBase):
|
||||
storage_path: Any = ...
|
||||
file_prefix: Any = ...
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
@classmethod
|
||||
def _get_storage_path(cls) -> str: ...
|
||||
def _key_to_file(self, session_key: Optional[str] = ...) -> str: ...
|
||||
def _last_modification(self): ...
|
||||
def _expiry_date(self, session_data: Any): ...
|
||||
_session_key: Any = ...
|
||||
def load(self) -> Dict[str, str]: ...
|
||||
modified: bool = ...
|
||||
def create(self) -> None: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def clean(self) -> None: ...
|
||||
@classmethod
|
||||
def clear_expired(cls) -> None: ...
|
||||
def create(self) -> None: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def exists(self, session_key: Optional[str]) -> bool: ...
|
||||
def load(self) -> Dict[str, str]: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
@@ -1,14 +1,22 @@
|
||||
# Stubs for django.contrib.sessions.backends.signed_cookies (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.contrib.sessions.backends.base import SessionBase
|
||||
from typing import Any, Optional
|
||||
|
||||
from datetime import datetime
|
||||
from typing import (
|
||||
Dict,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class SessionStore:
|
||||
def _get_session_key(self) -> str: ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def exists(self, session_key: str = ...) -> bool: ...
|
||||
from typing import Dict, Optional, Union
|
||||
class SessionStore(SessionBase):
|
||||
def load(self) -> Dict[str, Union[str, datetime]]: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
modified: bool = ...
|
||||
def create(self) -> None: ...
|
||||
_session_key: Any = ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
def exists(self, session_key: str = ...) -> bool: ...
|
||||
_session_cache: Any = ...
|
||||
def delete(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def cycle_key(self) -> None: ...
|
||||
def _get_session_key(self) -> str: ...
|
||||
@classmethod
|
||||
def clear_expired(cls) -> None: ...
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# Stubs for django.contrib.sessions.middleware (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
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:
|
||||
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,11 +1,14 @@
|
||||
# Stubs for django.contrib.sessions.serializers (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.core.signing import JSONSerializer as BaseJSONSerializer
|
||||
from typing import Any
|
||||
|
||||
from datetime import datetime
|
||||
from django.db.models.base import Model
|
||||
from typing import (
|
||||
Dict,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
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]: ...
|
||||
def loads(self, data: bytes) -> Dict[str, Model]: ...
|
||||
JSONSerializer = BaseJSONSerializer
|
||||
|
||||
Reference in New Issue
Block a user