Coverage for src/typedal/types.py: 100%
21 statements
« prev ^ index » next coverage.py v7.3.2, created at 2023-11-01 12:10 +0100
« prev ^ index » next coverage.py v7.3.2, created at 2023-11-01 12:10 +0100
1"""
2Stuff to make mypy happy.
3"""
4from typing import Any, Optional, TypedDict
6from pydal.objects import Expression as _Expression
7from pydal.objects import Field as _Field
8from pydal.objects import Query as _Query
11class Query(_Query): # type: ignore
12 """
13 Pydal Query object.
15 Makes mypy happy.
16 """
19class Expression(_Expression): # type: ignore
20 """
21 Pydal Expression object.
23 Make mypy happy.
24 """
27class Field(_Field):
28 """
29 Pydal Field object.
31 Make mypy happy.
32 """
35class _Types:
36 """
37 Internal type storage for stuff that mypy otherwise won't understand.
38 """
40 NONETYPE = type(None)
43class Pagination(TypedDict):
44 """
45 Pagination key of a paginate dict has these items.
46 """
48 total_items: int
49 current_page: int
50 per_page: int
51 total_pages: int
52 has_next_page: bool
53 has_prev_page: bool
54 next_page: Optional[int]
55 prev_page: Optional[int]
58class PaginateDict(TypedDict):
59 """
60 Result of PaginatedRows.as_dict().
61 """
63 data: dict[int, dict[str, Any]]
64 pagination: Pagination