mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-10-23 14:27:09 +08:00
initial commit
This commit is contained in:
commit
a9f215bf64
311 files changed
+13433
No files matched your search
@@ -0,0 +1,43 @@
|
||||
from datetime import (
|
||||
datetime,
|
||||
timedelta,
|
||||
)
|
||||
from django.db.models.base import Model
|
||||
from typing import (
|
||||
Dict,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class SessionBase:
|
||||
def __contains__(self, key: str) -> bool: ...
|
||||
def __delitem__(self, key: str) -> None: ...
|
||||
def __getitem__(self, key: str) -> Union[str, Model, int]: ...
|
||||
def __init__(self, session_key: Optional[str] = ...) -> None: ...
|
||||
def __setitem__(self, key: str, value: Union[str, datetime, int]) -> None: ...
|
||||
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[Model, int, str, datetime]]: ...
|
||||
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[int, str, 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 set_expiry(self, value: Optional[Union[int, datetime, timedelta]]) -> None: ...
|
||||
def setdefault(self, key: str, value: str) -> str: ...
|
||||
def test_cookie_worked(self) -> bool: ...
|
||||
def update(self, dict_: Dict[str, int]) -> None: ...
|
||||
@@ -0,0 +1,16 @@
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Optional,
|
||||
)
|
||||
|
||||
|
||||
class SessionStore:
|
||||
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: ...
|
||||
def load(self) -> Dict[Any, Any]: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
@@ -0,0 +1,16 @@
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Optional,
|
||||
)
|
||||
|
||||
|
||||
class SessionStore:
|
||||
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: ...
|
||||
@@ -0,0 +1,29 @@
|
||||
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:
|
||||
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[int, str, 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: ...
|
||||
@@ -0,0 +1,18 @@
|
||||
from typing import (
|
||||
Dict,
|
||||
Optional,
|
||||
)
|
||||
|
||||
|
||||
class SessionStore:
|
||||
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: ...
|
||||
@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: ...
|
||||
@@ -0,0 +1,14 @@
|
||||
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: ...
|
||||
def load(self) -> Dict[str, Union[str, datetime]]: ...
|
||||
def save(self, must_create: bool = ...) -> None: ...
|
||||
Reference in new issue
Block a user