diff --git a/django-stubs/contrib/sessions/backends/base.pyi b/django-stubs/contrib/sessions/backends/base.pyi index a42f2eb76..90dabee0f 100644 --- a/django-stubs/contrib/sessions/backends/base.pyi +++ b/django-stubs/contrib/sessions/backends/base.pyi @@ -13,12 +13,14 @@ class SessionBase(dict[str, Any]): modified: bool serializer: Any def __init__(self, session_key: str | None = ...) -> None: ... + @property + def key_salt(self) -> str: ... def set_test_cookie(self) -> None: ... def test_cookie_worked(self) -> bool: ... def delete_test_cookie(self) -> None: ... def encode(self, session_dict: dict[str, Any]) -> str: ... def decode(self, session_data: bytes | str) -> dict[str, Any]: ... - def has_key(self, key: Any) -> Any: ... + def has_key(self, key: Any) -> bool: ... def keys(self) -> Any: ... def values(self) -> Any: ... def items(self) -> Any: ... @@ -32,6 +34,7 @@ class SessionBase(dict[str, Any]): def _session_key(self) -> str | None: ... @_session_key.setter def _session_key(self, value: str | None) -> None: ... + def get_session_cookie_age(self) -> int: ... def get_expiry_age(self, **kwargs: Any) -> int: ... def get_expiry_date(self, **kwargs: Any) -> datetime: ... def set_expiry(self, value: datetime | int | None) -> None: ... diff --git a/django-stubs/contrib/sessions/backends/db.pyi b/django-stubs/contrib/sessions/backends/db.pyi index 7fb112a29..76578a853 100644 --- a/django-stubs/contrib/sessions/backends/db.pyi +++ b/django-stubs/contrib/sessions/backends/db.pyi @@ -1,12 +1,11 @@ from django.contrib.sessions.backends.base import SessionBase from django.contrib.sessions.base_session import AbstractBaseSession -from django.contrib.sessions.models import Session from django.db.models.base import Model class SessionStore(SessionBase): def __init__(self, session_key: str | None = ...) -> None: ... @classmethod - def get_model_class(cls) -> type[Session]: ... + def get_model_class(cls) -> type[AbstractBaseSession]: ... @property def model(self) -> type[AbstractBaseSession]: ... def create_model_instance(self, data: dict[str, Model]) -> AbstractBaseSession: ...