Skip to content

Commit cefb479

Browse files
committed
[5.0] Update core.paginator
1 parent 91c72c6 commit cefb479

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

django-stubs/core/paginator.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections.abc import Iterable, Iterator, Sequence, Sized
22
from typing import ClassVar, Generic, Protocol, TypeVar, overload, type_check_only
33

4-
from django.utils.functional import _StrPromise, cached_property
4+
from django.utils.functional import _StrOrPromise, _StrPromise, cached_property
55

66
class UnorderedObjectListWarning(RuntimeWarning): ...
77
class InvalidPage(Exception): ...
@@ -19,6 +19,8 @@ class _SupportsPagination(Protocol[_T], Sized, Iterable):
1919

2020
class Paginator(Generic[_T]):
2121
ELLIPSIS: ClassVar[_StrPromise]
22+
default_error_messages: ClassVar[dict[str, _StrPromise]]
23+
error_messages: dict[str, _StrOrPromise]
2224
object_list: _SupportsPagination[_T]
2325
per_page: int
2426
orphans: int
@@ -29,6 +31,7 @@ class Paginator(Generic[_T]):
2931
per_page: int | str,
3032
orphans: int = ...,
3133
allow_empty_first_page: bool = ...,
34+
error_messages: dict[str, _StrOrPromise] | None = ...,
3235
) -> None: ...
3336
def __iter__(self) -> Iterator[Page[_T]]: ...
3437
def validate_number(self, number: int | float | str) -> int: ...

scripts/stubtest/allowlist_todo_django50.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ django.core.handlers.asgi.ASGIHandler.run_get_response
124124
django.core.handlers.asgi.get_script_prefix
125125
django.core.management.commands.inspectdb.Command.normalize_table_name
126126
django.core.management.commands.optimizemigration
127-
django.core.paginator.Paginator.__init__
128-
django.core.paginator.Paginator.default_error_messages
129127
django.core.serializers.base.PickleSerializer
130128
django.core.validators.StepValueValidator.__init__
131129
django.db.backends.base.base.timezone_constructor

0 commit comments

Comments
 (0)