@@ -6,12 +6,14 @@ from django.db import models
66from django .db .models .query import QuerySet
77from django .http import HttpRequest , HttpResponse
88from django .utils .datastructures import _IndexableCollection
9+ from django .utils .functional import _Getter
910from django .views .generic .base import View
1011from django .views .generic .detail import BaseDetailView , SingleObjectTemplateResponseMixin
1112from django .views .generic .list import MultipleObjectMixin , MultipleObjectTemplateResponseMixin
1213from typing_extensions import TypeAlias
1314
1415_M = TypeVar ("_M" , bound = models .Model )
16+ _DatedItems : TypeAlias = tuple [_IndexableCollection [datetime .date ] | None , _IndexableCollection [_M ], dict [str , Any ]]
1517
1618class YearMixin :
1719 year_format : str
@@ -50,15 +52,12 @@ class DateMixin:
5052 allow_future : bool
5153 def get_date_field (self ) -> str : ...
5254 def get_allow_future (self ) -> bool : ...
53- @property
54- def uses_datetime_field (self ) -> bool : ...
55-
56- DatedItems : TypeAlias = tuple [_IndexableCollection [datetime .date ] | None , _IndexableCollection [_M ], dict [str , Any ]]
55+ uses_datetime_field : _Getter [bool ] | bool
5756
5857class BaseDateListView (MultipleObjectMixin [_M ], DateMixin , View ):
5958 date_list_period : str
6059 def get (self , request : HttpRequest , * args : Any , ** kwargs : Any ) -> HttpResponse : ...
61- def get_dated_items (self ) -> DatedItems : ...
60+ def get_dated_items (self ) -> _DatedItems : ...
6261 def get_ordering (self ) -> str | Sequence [str ]: ...
6362 def get_dated_queryset (self , ** lookup : Any ) -> models .query .QuerySet [_M ]: ...
6463 def get_date_list_period (self ) -> str : ...
@@ -68,41 +67,41 @@ class BaseDateListView(MultipleObjectMixin[_M], DateMixin, View):
6867
6968class BaseArchiveIndexView (BaseDateListView [_M ]):
7069 context_object_name : str
71- def get_dated_items (self ) -> DatedItems [_M ]: ...
70+ def get_dated_items (self ) -> _DatedItems [_M ]: ...
7271
7372class ArchiveIndexView (MultipleObjectTemplateResponseMixin , BaseArchiveIndexView ):
7473 template_name_suffix : str
7574
7675class BaseYearArchiveView (YearMixin , BaseDateListView [_M ]):
7776 date_list_period : str
7877 make_object_list : bool
79- def get_dated_items (self ) -> DatedItems [_M ]: ...
78+ def get_dated_items (self ) -> _DatedItems [_M ]: ...
8079 def get_make_object_list (self ) -> bool : ...
8180
8281class YearArchiveView (MultipleObjectTemplateResponseMixin , BaseYearArchiveView ):
8382 template_name_suffix : str
8483
8584class BaseMonthArchiveView (YearMixin , MonthMixin , BaseDateListView [_M ]):
8685 date_list_period : str
87- def get_dated_items (self ) -> DatedItems [_M ]: ...
86+ def get_dated_items (self ) -> _DatedItems [_M ]: ...
8887
8988class MonthArchiveView (MultipleObjectTemplateResponseMixin , BaseMonthArchiveView ):
9089 template_name_suffix : str
9190
9291class BaseWeekArchiveView (YearMixin , WeekMixin , BaseDateListView [_M ]):
93- def get_dated_items (self ) -> DatedItems [_M ]: ...
92+ def get_dated_items (self ) -> _DatedItems [_M ]: ...
9493
9594class WeekArchiveView (MultipleObjectTemplateResponseMixin , BaseWeekArchiveView ):
9695 template_name_suffix : str
9796
9897class BaseDayArchiveView (YearMixin , MonthMixin , DayMixin , BaseDateListView [_M ]):
99- def get_dated_items (self ) -> DatedItems [_M ]: ...
98+ def get_dated_items (self ) -> _DatedItems [_M ]: ...
10099
101100class DayArchiveView (MultipleObjectTemplateResponseMixin , BaseDayArchiveView ):
102101 template_name_suffix : str
103102
104103class BaseTodayArchiveView (BaseDayArchiveView [_M ]):
105- def get_dated_items (self ) -> DatedItems [_M ]: ...
104+ def get_dated_items (self ) -> _DatedItems [_M ]: ...
106105
107106class TodayArchiveView (MultipleObjectTemplateResponseMixin , BaseTodayArchiveView ):
108107 template_name_suffix : str
0 commit comments