TypeDAL 3.15.0__py3-none-any.whl → 3.15.1__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 +9 -3
- {typedal-3.15.0.dist-info → typedal-3.15.1.dist-info}/METADATA +1 -1
- {typedal-3.15.0.dist-info → typedal-3.15.1.dist-info}/RECORD +6 -6
- {typedal-3.15.0.dist-info → typedal-3.15.1.dist-info}/WHEEL +0 -0
- {typedal-3.15.0.dist-info → typedal-3.15.1.dist-info}/entry_points.txt +0 -0
typedal/__about__.py
CHANGED
typedal/core.py
CHANGED
|
@@ -120,7 +120,8 @@ OnQuery: typing.TypeAlias = typing.Optional[
|
|
|
120
120
|
]
|
|
121
121
|
]
|
|
122
122
|
|
|
123
|
-
To_Type = typing.TypeVar("To_Type", type[Any], Type[Any], str)
|
|
123
|
+
# To_Type = typing.TypeVar("To_Type", type[Any], Type[Any], str)
|
|
124
|
+
To_Type = typing.TypeVar("To_Type")
|
|
124
125
|
|
|
125
126
|
|
|
126
127
|
class Relationship(typing.Generic[To_Type]):
|
|
@@ -201,6 +202,7 @@ class Relationship(typing.Generic[To_Type]):
|
|
|
201
202
|
Get the table this relationship is bound to.
|
|
202
203
|
"""
|
|
203
204
|
table = self.table # can be a string because db wasn't available yet
|
|
205
|
+
|
|
204
206
|
if isinstance(table, str):
|
|
205
207
|
if mapped := db._class_map.get(table):
|
|
206
208
|
# yay
|
|
@@ -249,7 +251,9 @@ class Relationship(typing.Generic[To_Type]):
|
|
|
249
251
|
return None
|
|
250
252
|
|
|
251
253
|
|
|
252
|
-
def relationship(
|
|
254
|
+
def relationship(
|
|
255
|
+
_type: typing.Type[To_Type], condition: Condition = None, join: JOIN_OPTIONS = None, on: OnQuery = None
|
|
256
|
+
) -> To_Type:
|
|
253
257
|
"""
|
|
254
258
|
Define a relationship to another table, when its id is not stored in the current table.
|
|
255
259
|
|
|
@@ -584,7 +588,9 @@ class TypeDAL(pydal.DAL): # type: ignore
|
|
|
584
588
|
# by now, all relationships should be instances!
|
|
585
589
|
relationships=typing.cast(dict[str, Relationship[Any]], relationships),
|
|
586
590
|
)
|
|
591
|
+
# map both name and rname:
|
|
587
592
|
self._class_map[str(table)] = cls
|
|
593
|
+
self._class_map[table._rname] = cls
|
|
588
594
|
cls.__on_define__(self)
|
|
589
595
|
else:
|
|
590
596
|
warnings.warn("db.define used without inheriting TypedTable. This could lead to strange problems!")
|
|
@@ -713,7 +719,7 @@ class TypeDAL(pydal.DAL): # type: ignore
|
|
|
713
719
|
table class matches the input name.
|
|
714
720
|
|
|
715
721
|
Args:
|
|
716
|
-
table_name: The
|
|
722
|
+
table_name: The rname of the table to retrieve the mapped class for.
|
|
717
723
|
|
|
718
724
|
Returns:
|
|
719
725
|
The mapped table class if it exists, otherwise None.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
typedal/__about__.py,sha256=
|
|
1
|
+
typedal/__about__.py,sha256=Xso865lLoa6uJvYh9ngF2KTTM3rcjIC6XYtR4N1ioLk,207
|
|
2
2
|
typedal/__init__.py,sha256=Y6LT5UE3HrfWND_drJddYFbDjfnvqQER8MxZiEREFGw,366
|
|
3
3
|
typedal/caching.py,sha256=6YUzUMpan56nSy3D-Jl0FS-8V4LbTnpRSoDJHj6yPYo,11782
|
|
4
4
|
typedal/cli.py,sha256=SnWceLPDd-t90VPHAV9O3RR7JZtpVniT55TqtrRv3VM,19255
|
|
5
5
|
typedal/config.py,sha256=0qy1zrTUdtmXPM9jHzFnSR1DJsqGJqcdG6pvhzKQHe0,11625
|
|
6
|
-
typedal/core.py,sha256=
|
|
6
|
+
typedal/core.py,sha256=kC6CBUPExNAytOUggcPb1jIv_X1LrHayCEAkcT80GjY,109332
|
|
7
7
|
typedal/fields.py,sha256=oOmTonXG-g4Lpj5_gSr8GJ-EZIEqO435Fm8-MS_cmoc,7356
|
|
8
8
|
typedal/for_py4web.py,sha256=KIIu8XgnAfRQCJfZCra79k8SInOHiFuLDKUv3hzTJng,1908
|
|
9
9
|
typedal/for_web2py.py,sha256=xn7zo6ImsmTkH6LacbjLQl2oqyBvP0zLqRxEJvMQk1w,1929
|
|
@@ -13,7 +13,7 @@ typedal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
13
13
|
typedal/types.py,sha256=1FIgv1s0be0E8r5Wd9E1nvDvK4ETV8u2NlfI7_P6UUY,6752
|
|
14
14
|
typedal/web2py_py4web_shared.py,sha256=VK9T8P5UwVLvfNBsY4q79ANcABv-jX76YKADt1Zz_co,1539
|
|
15
15
|
typedal/serializers/as_json.py,sha256=3JZlFhPrdvZVFAmH7P5DUAz8-TIk-br0F1CjKG3PFDM,2246
|
|
16
|
-
typedal-3.15.
|
|
17
|
-
typedal-3.15.
|
|
18
|
-
typedal-3.15.
|
|
19
|
-
typedal-3.15.
|
|
16
|
+
typedal-3.15.1.dist-info/METADATA,sha256=-pJVFoXvP9KrqiyAvXxDkhqQ3hE7eVRLdtcgMNNEis4,10461
|
|
17
|
+
typedal-3.15.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
18
|
+
typedal-3.15.1.dist-info/entry_points.txt,sha256=m1wqcc_10rHWPdlQ71zEkmJDADUAnZtn7Jac_6mbyUc,44
|
|
19
|
+
typedal-3.15.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|