TypeDAL 3.12.1__py3-none-any.whl → 4.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- typedal/__about__.py +1 -1
- typedal/__init__.py +21 -3
- typedal/caching.py +37 -34
- typedal/cli.py +1 -1
- typedal/config.py +18 -16
- typedal/constants.py +25 -0
- typedal/core.py +202 -2784
- typedal/define.py +188 -0
- typedal/fields.py +319 -30
- typedal/for_py4web.py +2 -3
- typedal/for_web2py.py +1 -1
- typedal/helpers.py +355 -38
- typedal/mixins.py +28 -24
- typedal/query_builder.py +1119 -0
- typedal/relationships.py +390 -0
- typedal/rows.py +524 -0
- typedal/serializers/as_json.py +9 -10
- typedal/tables.py +1131 -0
- typedal/types.py +187 -179
- typedal/web2py_py4web_shared.py +3 -3
- {typedal-3.12.1.dist-info → typedal-4.2.0.dist-info}/METADATA +9 -8
- typedal-4.2.0.dist-info/RECORD +25 -0
- {typedal-3.12.1.dist-info → typedal-4.2.0.dist-info}/WHEEL +1 -1
- typedal-3.12.1.dist-info/RECORD +0 -19
- {typedal-3.12.1.dist-info → typedal-4.2.0.dist-info}/entry_points.txt +0 -0
typedal/types.py
CHANGED
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
Stuff to make mypy happy.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
# ---------------------------------------------------------------------------
|
|
6
|
+
# Imports
|
|
7
|
+
# ---------------------------------------------------------------------------
|
|
8
8
|
|
|
9
|
+
# Standard library
|
|
10
|
+
import datetime as dt
|
|
11
|
+
import types
|
|
12
|
+
import typing as t
|
|
13
|
+
|
|
14
|
+
import pydal.objects
|
|
15
|
+
|
|
16
|
+
# Third-party
|
|
9
17
|
from pydal.adapters.base import BaseAdapter
|
|
10
18
|
from pydal.helpers.classes import OpRow as _OpRow
|
|
11
19
|
from pydal.helpers.classes import Reference as _Reference
|
|
@@ -13,126 +21,157 @@ from pydal.helpers.classes import SQLCustomType
|
|
|
13
21
|
from pydal.objects import Expression as _Expression
|
|
14
22
|
from pydal.objects import Field as _Field
|
|
15
23
|
from pydal.objects import Query as _Query
|
|
24
|
+
from pydal.objects import Row as _Row
|
|
16
25
|
from pydal.objects import Rows as _Rows
|
|
17
26
|
from pydal.objects import Set as _Set
|
|
18
27
|
from pydal.objects import Table as _Table
|
|
19
28
|
from pydal.validators import Validator as _Validator
|
|
20
|
-
from typing_extensions import NotRequired
|
|
21
29
|
|
|
22
|
-
|
|
23
|
-
from .
|
|
30
|
+
try:
|
|
31
|
+
from string.templatelib import Template
|
|
32
|
+
except ImportError:
|
|
33
|
+
Template: t.TypeAlias = str # type: ignore
|
|
24
34
|
|
|
25
|
-
|
|
35
|
+
# Internal references
|
|
36
|
+
if t.TYPE_CHECKING:
|
|
37
|
+
from .fields import TypedField
|
|
38
|
+
from .tables import TypedTable
|
|
26
39
|
|
|
40
|
+
# ---------------------------------------------------------------------------
|
|
41
|
+
# Aliases
|
|
42
|
+
# ---------------------------------------------------------------------------
|
|
27
43
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Pydal Query object.
|
|
44
|
+
AnyCallable: t.TypeAlias = t.Callable[..., t.Any]
|
|
45
|
+
AnyDict: t.TypeAlias = dict[str, t.Any]
|
|
31
46
|
|
|
32
|
-
Makes mypy happy.
|
|
33
|
-
"""
|
|
34
47
|
|
|
48
|
+
# ---------------------------------------------------------------------------
|
|
49
|
+
# Protocols
|
|
50
|
+
# ---------------------------------------------------------------------------
|
|
35
51
|
|
|
36
|
-
class Expression(_Expression): # type: ignore
|
|
37
|
-
"""
|
|
38
|
-
Pydal Expression object.
|
|
39
52
|
|
|
40
|
-
|
|
41
|
-
"""
|
|
53
|
+
class TableProtocol(t.Protocol): # pragma: no cover
|
|
54
|
+
"""Protocol to make mypy happy for Tables."""
|
|
42
55
|
|
|
56
|
+
id: "TypedField[int]"
|
|
43
57
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
def __getitem__(self, item: str) -> "Field":
|
|
59
|
+
"""
|
|
60
|
+
Tables have table[field] syntax.
|
|
61
|
+
"""
|
|
47
62
|
|
|
48
|
-
|
|
63
|
+
|
|
64
|
+
class CacheFn(t.Protocol):
|
|
65
|
+
"""
|
|
66
|
+
The cache model (e.g. cache.ram) accepts these parameters (all filled by default).
|
|
49
67
|
"""
|
|
50
68
|
|
|
69
|
+
def __call__(
|
|
70
|
+
self: BaseAdapter,
|
|
71
|
+
sql: str = "",
|
|
72
|
+
fields: t.Iterable[str] = (),
|
|
73
|
+
attributes: t.Iterable[str] = (),
|
|
74
|
+
colnames: t.Iterable[str] = (),
|
|
75
|
+
) -> "Rows":
|
|
76
|
+
"""Signature for calling this object."""
|
|
51
77
|
|
|
52
|
-
if typing.TYPE_CHECKING:
|
|
53
78
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Pydal OpRow object for typing (otherwise mypy thinks it's Any).
|
|
79
|
+
class FileSystemLike(t.Protocol): # pragma: no cover
|
|
80
|
+
"""Protocol for any class that has an 'open' function (e.g. OSFS)."""
|
|
57
81
|
|
|
58
|
-
|
|
59
|
-
"""
|
|
82
|
+
def open(self, file: str, mode: str = "r") -> t.IO[t.Any]:
|
|
83
|
+
"""We assume every object with an open function this shape, is basically a file."""
|
|
60
84
|
|
|
61
|
-
def __getitem__(self, item: str) -> typing.Any:
|
|
62
|
-
"""
|
|
63
|
-
Dict [] get notation.
|
|
64
|
-
"""
|
|
65
85
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"""
|
|
86
|
+
# ---------------------------------------------------------------------------
|
|
87
|
+
# pydal Wrappers (to help mypy understand these classes)
|
|
88
|
+
# ---------------------------------------------------------------------------
|
|
70
89
|
|
|
71
|
-
# ... and more methods
|
|
72
90
|
|
|
73
|
-
|
|
91
|
+
class Query(_Query):
|
|
92
|
+
"""Pydal Query object. Makes mypy happy."""
|
|
74
93
|
|
|
75
|
-
class OpRow(_OpRow): # type: ignore
|
|
76
|
-
"""
|
|
77
|
-
Pydal OpRow object at runtime just uses pydal's version.
|
|
78
94
|
|
|
79
|
-
|
|
95
|
+
class Expression(_Expression):
|
|
96
|
+
"""Pydal Expression object. Make mypy happy."""
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class Set(_Set):
|
|
100
|
+
"""Pydal Set object. Make mypy happy."""
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
if t.TYPE_CHECKING:
|
|
104
|
+
|
|
105
|
+
class OpRow:
|
|
106
|
+
"""
|
|
107
|
+
Pydal OpRow object for typing (otherwise mypy thinks it's Any).
|
|
80
108
|
"""
|
|
81
109
|
|
|
110
|
+
def __getitem__(self, item: str) -> t.Any:
|
|
111
|
+
"""row.item syntax."""
|
|
82
112
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Pydal Reference object.
|
|
113
|
+
def __setitem__(self, key: str, value: t.Any) -> None:
|
|
114
|
+
"""row.item = key syntax."""
|
|
86
115
|
|
|
87
|
-
|
|
88
|
-
"""
|
|
116
|
+
# more methods could be added
|
|
89
117
|
|
|
118
|
+
else:
|
|
90
119
|
|
|
91
|
-
class
|
|
92
|
-
|
|
93
|
-
Pydal Field object.
|
|
120
|
+
class OpRow(_OpRow):
|
|
121
|
+
"""Runtime OpRow, using pydal's version."""
|
|
94
122
|
|
|
95
|
-
Make mypy happy.
|
|
96
|
-
"""
|
|
97
123
|
|
|
124
|
+
class Reference(_Reference):
|
|
125
|
+
"""Pydal Reference object. Make mypy happy."""
|
|
98
126
|
|
|
99
|
-
class Rows(_Rows): # type: ignore
|
|
100
|
-
"""
|
|
101
|
-
Pydal Rows object.
|
|
102
127
|
|
|
103
|
-
|
|
104
|
-
"""
|
|
128
|
+
class Field(_Field):
|
|
129
|
+
"""Pydal Field object. Make mypy happy."""
|
|
105
130
|
|
|
106
|
-
|
|
131
|
+
|
|
132
|
+
class Rows(_Rows):
|
|
133
|
+
"""Pydal Rows object. Make mypy happy."""
|
|
134
|
+
|
|
135
|
+
def column(self, column: t.Any = None) -> list[t.Any]:
|
|
107
136
|
"""
|
|
108
137
|
Get a list of all values in a specific column.
|
|
109
138
|
|
|
110
139
|
Example:
|
|
111
|
-
|
|
140
|
+
rows.column('name') -> ['Name 1', 'Name 2', ...]
|
|
112
141
|
"""
|
|
113
142
|
return [r[str(column) if column else self.colnames[0]] for r in self]
|
|
114
143
|
|
|
115
144
|
|
|
116
|
-
class
|
|
117
|
-
"""
|
|
118
|
-
Pydal Validator object.
|
|
145
|
+
class Row(_Row):
|
|
146
|
+
"""Pydal Row object. Make mypy happy."""
|
|
119
147
|
|
|
120
|
-
|
|
121
|
-
|
|
148
|
+
|
|
149
|
+
class Validator(_Validator):
|
|
150
|
+
"""Pydal Validator object. Make mypy happy."""
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class Table(_Table, TableProtocol):
|
|
154
|
+
"""Table with protocol support. Make mypy happy."""
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
# ---------------------------------------------------------------------------
|
|
158
|
+
# Utility Types
|
|
159
|
+
# ---------------------------------------------------------------------------
|
|
122
160
|
|
|
123
161
|
|
|
124
162
|
class _Types:
|
|
125
|
-
"""
|
|
126
|
-
Internal type storage for stuff that mypy otherwise won't understand.
|
|
127
|
-
"""
|
|
163
|
+
"""Internal type storage for stuff mypy otherwise won't understand."""
|
|
128
164
|
|
|
129
165
|
NONETYPE = type(None)
|
|
130
166
|
|
|
131
167
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
168
|
+
# ---------------------------------------------------------------------------
|
|
169
|
+
# TypedDicts
|
|
170
|
+
# ---------------------------------------------------------------------------
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class Pagination(t.TypedDict):
|
|
174
|
+
"""Pagination key of a paginate dict has these items."""
|
|
136
175
|
|
|
137
176
|
total_items: int
|
|
138
177
|
current_page: int
|
|
@@ -140,36 +179,30 @@ class Pagination(TypedDict):
|
|
|
140
179
|
total_pages: int
|
|
141
180
|
has_next_page: bool
|
|
142
181
|
has_prev_page: bool
|
|
143
|
-
next_page: Optional[int]
|
|
144
|
-
prev_page: Optional[int]
|
|
182
|
+
next_page: t.Optional[int]
|
|
183
|
+
prev_page: t.Optional[int]
|
|
145
184
|
|
|
146
185
|
|
|
147
|
-
class PaginateDict(TypedDict):
|
|
148
|
-
"""
|
|
149
|
-
Result of PaginatedRows.as_dict().
|
|
150
|
-
"""
|
|
186
|
+
class PaginateDict(t.TypedDict):
|
|
187
|
+
"""Result of PaginatedRows.as_dict()."""
|
|
151
188
|
|
|
152
189
|
data: dict[int, AnyDict]
|
|
153
190
|
pagination: Pagination
|
|
154
191
|
|
|
155
192
|
|
|
156
|
-
class CacheMetadata(TypedDict):
|
|
157
|
-
"""
|
|
158
|
-
Used by query builder metadata in the 'cache' key.
|
|
159
|
-
"""
|
|
193
|
+
class CacheMetadata(t.TypedDict):
|
|
194
|
+
"""Used by query builder metadata in the 'cache' key."""
|
|
160
195
|
|
|
161
196
|
enabled: bool
|
|
162
|
-
depends_on: list[Any]
|
|
163
|
-
key: NotRequired[str | None]
|
|
164
|
-
status: NotRequired[str | None]
|
|
165
|
-
expires_at: NotRequired[datetime | None]
|
|
166
|
-
cached_at: NotRequired[datetime | None]
|
|
197
|
+
depends_on: list[t.Any]
|
|
198
|
+
key: t.NotRequired[str | None]
|
|
199
|
+
status: t.NotRequired[str | None]
|
|
200
|
+
expires_at: t.NotRequired[dt.datetime | None]
|
|
201
|
+
cached_at: t.NotRequired[dt.datetime | None]
|
|
167
202
|
|
|
168
203
|
|
|
169
|
-
class PaginationMetadata(TypedDict):
|
|
170
|
-
"""
|
|
171
|
-
Used by query builder metadata in the 'pagination' key.
|
|
172
|
-
"""
|
|
204
|
+
class PaginationMetadata(t.TypedDict):
|
|
205
|
+
"""Used by query builder metadata in the 'pagination' key."""
|
|
173
206
|
|
|
174
207
|
limit: int
|
|
175
208
|
current_page: int
|
|
@@ -178,99 +211,34 @@ class PaginationMetadata(TypedDict):
|
|
|
178
211
|
min_max: tuple[int, int]
|
|
179
212
|
|
|
180
213
|
|
|
181
|
-
class
|
|
182
|
-
"""
|
|
183
|
-
Make mypy happy.
|
|
184
|
-
"""
|
|
185
|
-
|
|
186
|
-
id: "TypedField[int]"
|
|
187
|
-
|
|
188
|
-
def __getitem__(self, item: str) -> Field:
|
|
189
|
-
"""
|
|
190
|
-
Tell mypy a Table supports dictionary notation for columns.
|
|
191
|
-
"""
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
class Table(_Table, TableProtocol): # type: ignore
|
|
195
|
-
"""
|
|
196
|
-
Make mypy happy.
|
|
197
|
-
"""
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
class CacheFn(typing.Protocol):
|
|
201
|
-
"""
|
|
202
|
-
The cache model (e.g. cache.ram) accepts these parameters (all filled by dfeault).
|
|
203
|
-
"""
|
|
204
|
-
|
|
205
|
-
def __call__(
|
|
206
|
-
self: BaseAdapter,
|
|
207
|
-
sql: str = "",
|
|
208
|
-
fields: typing.Iterable[str] = (),
|
|
209
|
-
attributes: typing.Iterable[str] = (),
|
|
210
|
-
colnames: typing.Iterable[str] = (),
|
|
211
|
-
) -> Rows:
|
|
212
|
-
"""
|
|
213
|
-
Only used for type-hinting.
|
|
214
|
-
"""
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
# CacheFn = typing.Callable[[], Rows]
|
|
218
|
-
CacheModel = typing.Callable[[str, CacheFn, int], Rows]
|
|
219
|
-
CacheTuple = tuple[CacheModel, int]
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
class SelectKwargs(TypedDict, total=False):
|
|
223
|
-
"""
|
|
224
|
-
Possible keyword arguments for .select().
|
|
225
|
-
"""
|
|
214
|
+
class SelectKwargs(t.TypedDict, total=False):
|
|
215
|
+
"""Possible keyword arguments for .select()."""
|
|
226
216
|
|
|
227
|
-
join: Optional[list[Expression]]
|
|
228
|
-
left: Optional[list[Expression]]
|
|
229
|
-
orderby:
|
|
230
|
-
limitby: Optional[tuple[int, int]]
|
|
217
|
+
join: t.Optional[list[Expression]]
|
|
218
|
+
left: t.Optional[list[Expression]]
|
|
219
|
+
orderby: "OrderBy | t.Iterable[OrderBy] | None"
|
|
220
|
+
limitby: t.Optional[tuple[int, int]]
|
|
231
221
|
distinct: bool | Field | Expression
|
|
232
222
|
orderby_on_limitby: bool
|
|
233
223
|
cacheable: bool
|
|
234
|
-
cache: CacheTuple
|
|
224
|
+
cache: "CacheTuple"
|
|
235
225
|
|
|
236
226
|
|
|
237
|
-
class Metadata(TypedDict):
|
|
238
|
-
"""
|
|
239
|
-
Loosely structured metadata used by Query Builder.
|
|
240
|
-
"""
|
|
241
|
-
|
|
242
|
-
cache: NotRequired[CacheMetadata]
|
|
243
|
-
pagination: NotRequired[PaginationMetadata]
|
|
244
|
-
|
|
245
|
-
query: NotRequired[Query | str | None]
|
|
246
|
-
ids: NotRequired[str]
|
|
247
|
-
|
|
248
|
-
final_query: NotRequired[Query | str | None]
|
|
249
|
-
final_args: NotRequired[list[Any]]
|
|
250
|
-
final_kwargs: NotRequired[SelectKwargs]
|
|
251
|
-
relationships: NotRequired[set[str]]
|
|
252
|
-
|
|
253
|
-
sql: NotRequired[str]
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
class FileSystemLike(typing.Protocol): # pragma: no cover
|
|
257
|
-
"""
|
|
258
|
-
Protocol for any class that has an 'open' function.
|
|
259
|
-
|
|
260
|
-
An example of this is OSFS from PyFilesystem2.
|
|
261
|
-
"""
|
|
262
|
-
|
|
263
|
-
def open(self, file: str, mode: str = "r") -> typing.IO[typing.Any]:
|
|
264
|
-
"""
|
|
265
|
-
Opens a file for reading, writing or other modes.
|
|
266
|
-
"""
|
|
267
|
-
...
|
|
227
|
+
class Metadata(t.TypedDict):
|
|
228
|
+
"""Loosely structured metadata used by Query Builder."""
|
|
268
229
|
|
|
230
|
+
cache: t.NotRequired[CacheMetadata]
|
|
231
|
+
pagination: t.NotRequired[PaginationMetadata]
|
|
232
|
+
query: t.NotRequired[Query | str | None]
|
|
233
|
+
ids: t.NotRequired[str]
|
|
234
|
+
final_query: t.NotRequired[Query | str | None]
|
|
235
|
+
final_args: t.NotRequired[list[t.Any]]
|
|
236
|
+
final_kwargs: t.NotRequired[SelectKwargs]
|
|
237
|
+
relationships: t.NotRequired[set[str]]
|
|
238
|
+
sql: t.NotRequired[str]
|
|
269
239
|
|
|
270
|
-
AnyCallable: typing.TypeAlias = Callable[..., Any]
|
|
271
240
|
|
|
272
|
-
|
|
273
|
-
class FieldSettings(TypedDict, total=False):
|
|
241
|
+
class FieldSettings(t.TypedDict, total=False):
|
|
274
242
|
"""
|
|
275
243
|
The supported keyword arguments for `pydal.Field()`.
|
|
276
244
|
|
|
@@ -279,9 +247,9 @@ class FieldSettings(TypedDict, total=False):
|
|
|
279
247
|
|
|
280
248
|
type: str | type | SQLCustomType
|
|
281
249
|
length: int
|
|
282
|
-
default: Any
|
|
250
|
+
default: t.Any
|
|
283
251
|
required: bool
|
|
284
|
-
requires: list[AnyCallable | Any | Validator] | Validator | AnyCallable
|
|
252
|
+
requires: list[AnyCallable | t.Any | Validator] | Validator | AnyCallable
|
|
285
253
|
ondelete: str
|
|
286
254
|
onupdate: str
|
|
287
255
|
notnull: bool
|
|
@@ -295,8 +263,8 @@ class FieldSettings(TypedDict, total=False):
|
|
|
295
263
|
searchable: bool
|
|
296
264
|
listable: bool
|
|
297
265
|
regex: str
|
|
298
|
-
options: list[Any] | AnyCallable
|
|
299
|
-
update: Any
|
|
266
|
+
options: list[t.Any] | AnyCallable
|
|
267
|
+
update: t.Any
|
|
300
268
|
authorize: AnyCallable
|
|
301
269
|
autodelete: bool
|
|
302
270
|
represent: AnyCallable
|
|
@@ -310,6 +278,46 @@ class FieldSettings(TypedDict, total=False):
|
|
|
310
278
|
custom_delete: AnyCallable
|
|
311
279
|
filter_in: AnyCallable
|
|
312
280
|
filter_out: AnyCallable
|
|
313
|
-
custom_qualifier: Any
|
|
314
|
-
map_none: Any
|
|
281
|
+
custom_qualifier: t.Any
|
|
282
|
+
map_none: t.Any
|
|
315
283
|
rname: str
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
# ---------------------------------------------------------------------------
|
|
287
|
+
# Generics & Query Helpers
|
|
288
|
+
# ---------------------------------------------------------------------------
|
|
289
|
+
|
|
290
|
+
T = t.TypeVar("T", bound=t.Any)
|
|
291
|
+
P = t.ParamSpec("P")
|
|
292
|
+
R = t.TypeVar("R")
|
|
293
|
+
|
|
294
|
+
T_MetaInstance = t.TypeVar("T_MetaInstance", bound="TypedTable")
|
|
295
|
+
T_Query = t.Union[
|
|
296
|
+
"Table",
|
|
297
|
+
Query,
|
|
298
|
+
bool,
|
|
299
|
+
None,
|
|
300
|
+
"TypedTable",
|
|
301
|
+
t.Type["TypedTable"],
|
|
302
|
+
Expression,
|
|
303
|
+
]
|
|
304
|
+
|
|
305
|
+
T_subclass = t.TypeVar("T_subclass", "TypedTable", Table)
|
|
306
|
+
T_Field: t.TypeAlias = t.Union["TypedField[t.Any]", "Table", t.Type["TypedTable"]]
|
|
307
|
+
|
|
308
|
+
# use typing.cast(type, ...) to make mypy happy with unions
|
|
309
|
+
T_Value = t.TypeVar("T_Value") # actual type of the Field (via Generic)
|
|
310
|
+
|
|
311
|
+
# table-ish parameter:
|
|
312
|
+
P_Table = t.Union[t.Type["TypedTable"], pydal.objects.Table]
|
|
313
|
+
|
|
314
|
+
Condition: t.TypeAlias = t.Optional[t.Callable[[P_Table, P_Table], Query | bool]]
|
|
315
|
+
|
|
316
|
+
OnQuery: t.TypeAlias = t.Optional[t.Callable[[P_Table, P_Table], list[Expression]]]
|
|
317
|
+
|
|
318
|
+
CacheModel = t.Callable[[str, CacheFn, int], Rows]
|
|
319
|
+
CacheTuple = tuple[CacheModel, int]
|
|
320
|
+
|
|
321
|
+
OrderBy: t.TypeAlias = str | Expression
|
|
322
|
+
|
|
323
|
+
T_annotation = t.Type[t.Any] | types.UnionType
|
typedal/web2py_py4web_shared.py
CHANGED
|
@@ -6,7 +6,7 @@ import datetime as dt
|
|
|
6
6
|
|
|
7
7
|
from pydal.validators import CRYPT, IS_EMAIL, IS_NOT_EMPTY, IS_NOT_IN_DB, IS_STRONG
|
|
8
8
|
|
|
9
|
-
from .
|
|
9
|
+
from . import TypeDAL, TypedField, TypedTable
|
|
10
10
|
from .fields import PasswordField
|
|
11
11
|
|
|
12
12
|
|
|
@@ -35,10 +35,10 @@ class AuthUser(TypedTable):
|
|
|
35
35
|
"""
|
|
36
36
|
super().__on_define__(db)
|
|
37
37
|
|
|
38
|
-
cls.email.requires =
|
|
38
|
+
cls.email.requires = [
|
|
39
39
|
IS_EMAIL(),
|
|
40
40
|
IS_NOT_IN_DB(
|
|
41
41
|
db,
|
|
42
42
|
"auth_user.email",
|
|
43
43
|
),
|
|
44
|
-
|
|
44
|
+
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: TypeDAL
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.2.0
|
|
4
4
|
Summary: Typing support for PyDAL
|
|
5
5
|
Project-URL: Documentation, https://typedal.readthedocs.io/
|
|
6
6
|
Project-URL: Issues, https://github.com/trialandsuccess/TypeDAL/issues
|
|
@@ -8,19 +8,20 @@ Project-URL: Source, https://github.com/trialandsuccess/TypeDAL
|
|
|
8
8
|
Author-email: Robin van der Noord <contact@trialandsuccess.nl>
|
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
|
10
10
|
Classifier: Programming Language :: Python
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
15
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
16
16
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
17
|
-
Requires-Python: >=3.
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
18
|
Requires-Dist: configurable-json<2
|
|
19
|
-
Requires-Dist: configuraptor<2,>=1.
|
|
19
|
+
Requires-Dist: configuraptor<2,>=1.27.1
|
|
20
20
|
Requires-Dist: dill<1
|
|
21
21
|
Requires-Dist: legacy-cgi; python_version >= '3.13'
|
|
22
|
-
Requires-Dist: pydal
|
|
23
|
-
Requires-Dist: python-
|
|
22
|
+
Requires-Dist: pydal>=20251012.3
|
|
23
|
+
Requires-Dist: python-dateutil<3
|
|
24
|
+
Requires-Dist: python-slugify<9
|
|
24
25
|
Provides-Extra: all
|
|
25
26
|
Requires-Dist: edwh-migrate[full]>=0.8.0; extra == 'all'
|
|
26
27
|
Requires-Dist: py4web; extra == 'all'
|
|
@@ -28,7 +29,7 @@ Requires-Dist: pydal2sql[all]>=1.2.0; extra == 'all'
|
|
|
28
29
|
Requires-Dist: questionary; extra == 'all'
|
|
29
30
|
Requires-Dist: tabulate; extra == 'all'
|
|
30
31
|
Requires-Dist: tomlkit; extra == 'all'
|
|
31
|
-
Requires-Dist: typer; extra == 'all'
|
|
32
|
+
Requires-Dist: typer<0.19,>=0.18; extra == 'all'
|
|
32
33
|
Provides-Extra: dev
|
|
33
34
|
Requires-Dist: contextlib-chdir; extra == 'dev'
|
|
34
35
|
Requires-Dist: hatch; extra == 'dev'
|
|
@@ -48,7 +49,7 @@ Requires-Dist: pydal2sql>=1.2.0; extra == 'migrations'
|
|
|
48
49
|
Requires-Dist: questionary; extra == 'migrations'
|
|
49
50
|
Requires-Dist: tabulate; extra == 'migrations'
|
|
50
51
|
Requires-Dist: tomlkit; extra == 'migrations'
|
|
51
|
-
Requires-Dist: typer; extra == 'migrations'
|
|
52
|
+
Requires-Dist: typer<0.19,>=0.18; extra == 'migrations'
|
|
52
53
|
Provides-Extra: py4web
|
|
53
54
|
Requires-Dist: py4web; extra == 'py4web'
|
|
54
55
|
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
typedal/__about__.py,sha256=DJPGXqVcRPOC6WiyPJUio8tzSICj6wmHoYWyKag1xKc,206
|
|
2
|
+
typedal/__init__.py,sha256=F6cVdXLeEhgcHEo6f_OEYN7xGEl2mEehSp1nyBr6NRI,648
|
|
3
|
+
typedal/caching.py,sha256=DCgGAw709Z1xubTIu5S-JhEXq9xZptm_gS7foIDFm2k,11779
|
|
4
|
+
typedal/cli.py,sha256=SnWceLPDd-t90VPHAV9O3RR7JZtpVniT55TqtrRv3VM,19255
|
|
5
|
+
typedal/config.py,sha256=pXU0Bls2FgiZyqHDOka64swdZhFieJX5NPgG_5bBaXY,11716
|
|
6
|
+
typedal/constants.py,sha256=ahmryNsTBZVW0sHq8WbkZKQytWVZSIAZjZbZdod0iHY,489
|
|
7
|
+
typedal/core.py,sha256=z_RtH4wU9f5JulYa8ojVpbnU9Mga-JjQrsevrFlaj0c,15261
|
|
8
|
+
typedal/define.py,sha256=JYdjtM0UQ_taEXFEAhPlVzVrdV__vJNjAT-Eyp5DDX0,6962
|
|
9
|
+
typedal/fields.py,sha256=4JQq-FXPMToMDpDFa2yuf1_I2V66tQ_f8bJpV23DtMU,15923
|
|
10
|
+
typedal/for_py4web.py,sha256=2GkGFfrZH0n8ceWI8uwaf1dbQ1KIQ6-Q2XJznbrcvnE,1892
|
|
11
|
+
typedal/for_web2py.py,sha256=Bvgicr19KNwjp1P_t9K1EmhaM3EfowPQyomUaO-2Wmo,1925
|
|
12
|
+
typedal/helpers.py,sha256=LxyPINYEPhIiSTrzUVNdGBV9IqXuefs7AIGLrVS09vk,19910
|
|
13
|
+
typedal/mixins.py,sha256=V-l9eZtyIBocSKYQ-yk3oyHVk63F5XdzQe_OGspaviY,7910
|
|
14
|
+
typedal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
+
typedal/query_builder.py,sha256=Cnro44l_86Vlk5-xuXX5f8oDakEfvHf42yMQGmnlNKQ,41391
|
|
16
|
+
typedal/relationships.py,sha256=b9MLGBwSxDYoElSMUjWmmcFe68pPCtQ-0ePX11s5VLc,14255
|
|
17
|
+
typedal/rows.py,sha256=DBxQ_6rxhx-uq8V-j3iPXFBW03TfAkX5gCYzBvvakJ0,16354
|
|
18
|
+
typedal/tables.py,sha256=jcqyRdO4Ykz4cjW0dvoNKaObu8jiuVQ1-TNwvJczVog,36985
|
|
19
|
+
typedal/types.py,sha256=IjMepwIaOY65zrZk7Wf2u0blv-V1TABqxmCsnF0E9KU,8566
|
|
20
|
+
typedal/web2py_py4web_shared.py,sha256=jsDjC_K0P27od4B80q83nKJiL2KAgmzS-QpHChv0RjU,1535
|
|
21
|
+
typedal/serializers/as_json.py,sha256=pdeFoQF5kouGonJC6z6JNe61XRsIMlQ94SRBJDKG_Ng,2219
|
|
22
|
+
typedal-4.2.0.dist-info/METADATA,sha256=hcpUO43AWzf5V-aukarT_SvZRfOoX_UZ3nHDg0LgiTM,10517
|
|
23
|
+
typedal-4.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
24
|
+
typedal-4.2.0.dist-info/entry_points.txt,sha256=m1wqcc_10rHWPdlQ71zEkmJDADUAnZtn7Jac_6mbyUc,44
|
|
25
|
+
typedal-4.2.0.dist-info/RECORD,,
|
typedal-3.12.1.dist-info/RECORD
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
typedal/__about__.py,sha256=ARJQ49bbVhahzI6nSYn006t7zxxkUgsEfxoprsV2_oQ,207
|
|
2
|
-
typedal/__init__.py,sha256=QQpLiVl9w9hm2LBxey49Y_tCF_VB2bScVaS_mCjYy54,366
|
|
3
|
-
typedal/caching.py,sha256=6YUzUMpan56nSy3D-Jl0FS-8V4LbTnpRSoDJHj6yPYo,11782
|
|
4
|
-
typedal/cli.py,sha256=FInI6LuhCbJXhh6qAqXpaPPckdkIQKGydnGYOo0_cm8,19253
|
|
5
|
-
typedal/config.py,sha256=0qy1zrTUdtmXPM9jHzFnSR1DJsqGJqcdG6pvhzKQHe0,11625
|
|
6
|
-
typedal/core.py,sha256=da5zTuvkMXnTlUyUH0Q_BTP83cnD7dAE5wsiUdvnsDw,104609
|
|
7
|
-
typedal/fields.py,sha256=ThkI0_E6Oq_2Vj30j0AWHRSOLvUEPu1gyECtStoECjs,6556
|
|
8
|
-
typedal/for_py4web.py,sha256=rE1kOXF6pUx0ya9jWMjGYaoFCpbYtjcYxccSvUo9o9M,1946
|
|
9
|
-
typedal/for_web2py.py,sha256=xn7zo6ImsmTkH6LacbjLQl2oqyBvP0zLqRxEJvMQk1w,1929
|
|
10
|
-
typedal/helpers.py,sha256=uej96exzJ9qVBd6LudP8uJ_7Cmq6vKraerdKvSRBVjc,8128
|
|
11
|
-
typedal/mixins.py,sha256=ySF55URmSMyUCdMhiQJSKjkz4s5XGaO1pvmpJAOLUSU,7821
|
|
12
|
-
typedal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
typedal/types.py,sha256=1FIgv1s0be0E8r5Wd9E1nvDvK4ETV8u2NlfI7_P6UUY,6752
|
|
14
|
-
typedal/web2py_py4web_shared.py,sha256=VK9T8P5UwVLvfNBsY4q79ANcABv-jX76YKADt1Zz_co,1539
|
|
15
|
-
typedal/serializers/as_json.py,sha256=ffo152W-sARYXym4BzwX709rrO2-QwKk2KunWY8RNl4,2229
|
|
16
|
-
typedal-3.12.1.dist-info/METADATA,sha256=Ar9qhhfGqcenDpMUKJPq9OJg-wb4fnDJbPWj6zGzksw,10461
|
|
17
|
-
typedal-3.12.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
18
|
-
typedal-3.12.1.dist-info/entry_points.txt,sha256=m1wqcc_10rHWPdlQ71zEkmJDADUAnZtn7Jac_6mbyUc,44
|
|
19
|
-
typedal-3.12.1.dist-info/RECORD,,
|
|
File without changes
|