Skip to content

Commit

Permalink
AbstractBaseSession: Use ClassVar (credit: @flaeppe)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed May 24, 2024
1 parent 6cbe46c commit ae795ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion django-stubs/contrib/sessions/base_session.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from datetime import datetime
from typing import Any, TypeVar
from typing import Any, ClassVar, TypeVar

from django.contrib.sessions.backends.base import SessionBase
from django.db import models
from typing_extensions import Self

_T = TypeVar("_T", bound=AbstractBaseSession)

Expand All @@ -14,6 +15,7 @@ class AbstractBaseSession(models.Model):
session_key = models.CharField(primary_key=True)
session_data = models.TextField()
expire_date = models.DateTimeField()
objects: ClassVar[BaseSessionManager[Self]]

@classmethod
def get_session_store_class(cls) -> type[SessionBase] | None: ...
Expand Down
1 change: 1 addition & 0 deletions scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ django.contrib.sessions.backends.signed_cookies.SessionStore.exists
django.contrib.sessions.base_session.AbstractBaseSession.expire_date
django.contrib.sessions.base_session.AbstractBaseSession.get_next_by_expire_date
django.contrib.sessions.base_session.AbstractBaseSession.get_previous_by_expire_date
django.contrib.sessions.base_session.AbstractBaseSession.objects
django.contrib.sessions.base_session.AbstractBaseSession.session_data
django.contrib.sessions.base_session.AbstractBaseSession.session_key
django.contrib.sessions.base_session.BaseSessionManager.__slotnames__
Expand Down

0 comments on commit ae795ce

Please sign in to comment.