TypeDAL 3.17.1__py3-none-any.whl → 3.17.2__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.
Potentially problematic release.
This version of TypeDAL might be problematic. Click here for more details.
- typedal/__about__.py +1 -1
- typedal/core.py +23 -0
- typedal/types.py +3 -1
- {typedal-3.17.1.dist-info → typedal-3.17.2.dist-info}/METADATA +1 -1
- {typedal-3.17.1.dist-info → typedal-3.17.2.dist-info}/RECORD +7 -7
- {typedal-3.17.1.dist-info → typedal-3.17.2.dist-info}/WHEEL +0 -0
- {typedal-3.17.1.dist-info → typedal-3.17.2.dist-info}/entry_points.txt +0 -0
typedal/__about__.py
CHANGED
typedal/core.py
CHANGED
|
@@ -60,6 +60,7 @@ from .types import (
|
|
|
60
60
|
FieldSettings,
|
|
61
61
|
Metadata,
|
|
62
62
|
OpRow,
|
|
63
|
+
OrderBy,
|
|
63
64
|
PaginateDict,
|
|
64
65
|
Pagination,
|
|
65
66
|
Query,
|
|
@@ -1146,6 +1147,12 @@ class TableMeta(type):
|
|
|
1146
1147
|
"""
|
|
1147
1148
|
return QueryBuilder(self).where(*a, **kw)
|
|
1148
1149
|
|
|
1150
|
+
def orderby(self: Type[T_MetaInstance], *fields: OrderBy) -> "QueryBuilder[T_MetaInstance]":
|
|
1151
|
+
"""
|
|
1152
|
+
See QueryBuilder.orderby!
|
|
1153
|
+
"""
|
|
1154
|
+
return QueryBuilder(self).orderby(*fields)
|
|
1155
|
+
|
|
1149
1156
|
def cache(self: Type[T_MetaInstance], *deps: Any, **kwargs: Any) -> "QueryBuilder[T_MetaInstance]":
|
|
1150
1157
|
"""
|
|
1151
1158
|
See QueryBuilder.cache!
|
|
@@ -2678,6 +2685,22 @@ class QueryBuilder(typing.Generic[T_MetaInstance]):
|
|
|
2678
2685
|
"""
|
|
2679
2686
|
return self._extend(select_args=list(fields), select_kwargs=options)
|
|
2680
2687
|
|
|
2688
|
+
def orderby(self, *fields: OrderBy) -> "QueryBuilder[T_MetaInstance]":
|
|
2689
|
+
"""
|
|
2690
|
+
Order the query results by specified fields.
|
|
2691
|
+
|
|
2692
|
+
Args:
|
|
2693
|
+
fields: field(s) to order by. Supported:
|
|
2694
|
+
table.name - sort by name, ascending
|
|
2695
|
+
~table.name - sort by name, descending
|
|
2696
|
+
<random> - sort randomly
|
|
2697
|
+
table.name|table.id - sort by two fields (first name, then id)
|
|
2698
|
+
|
|
2699
|
+
Returns:
|
|
2700
|
+
QueryBuilder: A new QueryBuilder instance with the ordering applied.
|
|
2701
|
+
"""
|
|
2702
|
+
return self.select(orderby=fields)
|
|
2703
|
+
|
|
2681
2704
|
def where(
|
|
2682
2705
|
self,
|
|
2683
2706
|
*queries_or_lambdas: Query | typing.Callable[[Type[T_MetaInstance]], Query] | dict[str, Any],
|
typedal/types.py
CHANGED
|
@@ -218,6 +218,8 @@ class CacheFn(typing.Protocol):
|
|
|
218
218
|
CacheModel = typing.Callable[[str, CacheFn, int], Rows]
|
|
219
219
|
CacheTuple = tuple[CacheModel, int]
|
|
220
220
|
|
|
221
|
+
OrderBy: typing.TypeAlias = Expression | str
|
|
222
|
+
|
|
221
223
|
|
|
222
224
|
class SelectKwargs(TypedDict, total=False):
|
|
223
225
|
"""
|
|
@@ -226,7 +228,7 @@ class SelectKwargs(TypedDict, total=False):
|
|
|
226
228
|
|
|
227
229
|
join: Optional[list[Expression]]
|
|
228
230
|
left: Optional[list[Expression]]
|
|
229
|
-
orderby:
|
|
231
|
+
orderby: OrderBy | typing.Iterable[OrderBy] | None
|
|
230
232
|
limitby: Optional[tuple[int, int]]
|
|
231
233
|
distinct: bool | Field | Expression
|
|
232
234
|
orderby_on_limitby: bool
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
typedal/__about__.py,sha256=
|
|
1
|
+
typedal/__about__.py,sha256=8QxLmIYG_8pjN9osMaqR9cgfFChPa8chMgVGeo0Jc4k,207
|
|
2
2
|
typedal/__init__.py,sha256=mCU8C3xPYiGcai4PYIoZNJSkFa1jb0MHkV8s2XXqEeY,484
|
|
3
3
|
typedal/caching.py,sha256=6YUzUMpan56nSy3D-Jl0FS-8V4LbTnpRSoDJHj6yPYo,11782
|
|
4
4
|
typedal/cli.py,sha256=e08L8k6q1NGSzpKs7ywin0uwkK7Kz07I4REVjHdbyyE,19267
|
|
5
5
|
typedal/config.py,sha256=0qy1zrTUdtmXPM9jHzFnSR1DJsqGJqcdG6pvhzKQHe0,11625
|
|
6
|
-
typedal/core.py,sha256=
|
|
6
|
+
typedal/core.py,sha256=P2mi-j3YLw135iTbTRMKlx8_9EhxcWjmrH15qisBKpU,118519
|
|
7
7
|
typedal/fields.py,sha256=bZIgjl3Lj7eMqFCyt-bogsS_BqIs3cETEUH4W59qiXw,8425
|
|
8
8
|
typedal/for_py4web.py,sha256=KIIu8XgnAfRQCJfZCra79k8SInOHiFuLDKUv3hzTJng,1908
|
|
9
9
|
typedal/for_web2py.py,sha256=xn7zo6ImsmTkH6LacbjLQl2oqyBvP0zLqRxEJvMQk1w,1929
|
|
10
10
|
typedal/helpers.py,sha256=fvej53MqWG1n78-uTuxUEfLDpKrXJDOaIysogBFT3ns,11298
|
|
11
11
|
typedal/mixins.py,sha256=NiGp-3Lr1lllWjP-whUhc_2HXwCS_ROB0bs5N_s9wk4,7976
|
|
12
12
|
typedal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
typedal/types.py,sha256=
|
|
13
|
+
typedal/types.py,sha256=P5O0WMADoNm6eDBQZUs9eTK4Puzqz5ZDCFofCIl84Cg,6805
|
|
14
14
|
typedal/web2py_py4web_shared.py,sha256=UYmD0_aK1bSVBt_f3j59Mxq-zOmQNkYkb8sPDUibq68,1539
|
|
15
15
|
typedal/serializers/as_json.py,sha256=3JZlFhPrdvZVFAmH7P5DUAz8-TIk-br0F1CjKG3PFDM,2246
|
|
16
|
-
typedal-3.17.
|
|
17
|
-
typedal-3.17.
|
|
18
|
-
typedal-3.17.
|
|
19
|
-
typedal-3.17.
|
|
16
|
+
typedal-3.17.2.dist-info/METADATA,sha256=GyezlYlNCyUG9Iw8fXLc8xo4e3LmAKho_FIVLNx1abc,10461
|
|
17
|
+
typedal-3.17.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
18
|
+
typedal-3.17.2.dist-info/entry_points.txt,sha256=m1wqcc_10rHWPdlQ71zEkmJDADUAnZtn7Jac_6mbyUc,44
|
|
19
|
+
typedal-3.17.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|