1
1
from collections .abc import Iterable , Iterator , Sequence , Sized
2
2
from typing import ClassVar , Generic , Protocol , TypeVar , overload , type_check_only
3
3
4
- from django .utils .functional import _StrPromise , cached_property
4
+ from django .utils .functional import _StrOrPromise , _StrPromise , cached_property
5
5
6
6
class UnorderedObjectListWarning (RuntimeWarning ): ...
7
7
class InvalidPage (Exception ): ...
@@ -19,6 +19,8 @@ class _SupportsPagination(Protocol[_T], Sized, Iterable):
19
19
20
20
class Paginator (Generic [_T ]):
21
21
ELLIPSIS : ClassVar [_StrPromise ]
22
+ default_error_messages : ClassVar [dict [str , _StrPromise ]]
23
+ error_messages : dict [str , _StrOrPromise ]
22
24
object_list : _SupportsPagination [_T ]
23
25
per_page : int
24
26
orphans : int
@@ -29,6 +31,7 @@ class Paginator(Generic[_T]):
29
31
per_page : int | str ,
30
32
orphans : int = ...,
31
33
allow_empty_first_page : bool = ...,
34
+ error_messages : dict [str , _StrOrPromise ] | None = ...,
32
35
) -> None : ...
33
36
def __iter__ (self ) -> Iterator [Page [_T ]]: ...
34
37
def validate_number (self , number : int | float | str ) -> int : ...
0 commit comments