TypeDAL 3.14.1__py3-none-any.whl → 3.14.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/cli.py +1 -2
- typedal/fields.py +25 -2
- {typedal-3.14.1.dist-info → typedal-3.14.2.dist-info}/METADATA +1 -1
- {typedal-3.14.1.dist-info → typedal-3.14.2.dist-info}/RECORD +7 -7
- {typedal-3.14.1.dist-info → typedal-3.14.2.dist-info}/WHEEL +0 -0
- {typedal-3.14.1.dist-info → typedal-3.14.2.dist-info}/entry_points.txt +0 -0
typedal/__about__.py
CHANGED
typedal/cli.py
CHANGED
|
@@ -392,8 +392,7 @@ def fake_migrations(
|
|
|
392
392
|
|
|
393
393
|
previously_migrated = (
|
|
394
394
|
db(
|
|
395
|
-
db.ewh_implemented_features.name.belongs(to_fake)
|
|
396
|
-
& (db.ewh_implemented_features.installed == True) # noqa E712
|
|
395
|
+
db.ewh_implemented_features.name.belongs(to_fake) & (db.ewh_implemented_features.installed == True) # noqa E712
|
|
397
396
|
)
|
|
398
397
|
.select(db.ewh_implemented_features.name)
|
|
399
398
|
.column("name")
|
typedal/fields.py
CHANGED
|
@@ -256,11 +256,34 @@ def TimestampField(**kw: Unpack[FieldSettings]) -> TypedField[dt.datetime]:
|
|
|
256
256
|
)
|
|
257
257
|
|
|
258
258
|
|
|
259
|
+
def safe_decode_native_point(value: str | None):
|
|
260
|
+
if not value:
|
|
261
|
+
return ()
|
|
262
|
+
|
|
263
|
+
try:
|
|
264
|
+
return ast.literal_eval(value)
|
|
265
|
+
except ValueError: # pragma: no cover
|
|
266
|
+
# should not happen when inserted with `safe_encode_native_point` but you never know
|
|
267
|
+
return ()
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
def safe_encode_native_point(value):
|
|
271
|
+
if not value:
|
|
272
|
+
return ""
|
|
273
|
+
|
|
274
|
+
if isinstance(value, str):
|
|
275
|
+
value = tuple(float(_) for _ in value.strip("(").strip(")").split(","))
|
|
276
|
+
if not (isinstance(value, tuple) and len(value) == 2):
|
|
277
|
+
raise ValueError("Invalid point tuple")
|
|
278
|
+
|
|
279
|
+
return str(value)
|
|
280
|
+
|
|
281
|
+
|
|
259
282
|
NativePointField = SQLCustomType(
|
|
260
283
|
type="string",
|
|
261
284
|
native="point",
|
|
262
|
-
encoder=
|
|
263
|
-
decoder=
|
|
285
|
+
encoder=safe_encode_native_point,
|
|
286
|
+
decoder=safe_decode_native_point,
|
|
264
287
|
)
|
|
265
288
|
|
|
266
289
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
typedal/__about__.py,sha256=
|
|
1
|
+
typedal/__about__.py,sha256=LnRkisJqR9TtSx6juk47Ol7hpJEmaJC8mGpen-Uf_Cc,207
|
|
2
2
|
typedal/__init__.py,sha256=Y6LT5UE3HrfWND_drJddYFbDjfnvqQER8MxZiEREFGw,366
|
|
3
3
|
typedal/caching.py,sha256=6YUzUMpan56nSy3D-Jl0FS-8V4LbTnpRSoDJHj6yPYo,11782
|
|
4
|
-
typedal/cli.py,sha256=
|
|
4
|
+
typedal/cli.py,sha256=SnWceLPDd-t90VPHAV9O3RR7JZtpVniT55TqtrRv3VM,19255
|
|
5
5
|
typedal/config.py,sha256=0qy1zrTUdtmXPM9jHzFnSR1DJsqGJqcdG6pvhzKQHe0,11625
|
|
6
6
|
typedal/core.py,sha256=GYNX7aGaqaPWZUYTxiNDAswQi7jeP87qAlYk1OzCO5g,108942
|
|
7
|
-
typedal/fields.py,sha256=
|
|
7
|
+
typedal/fields.py,sha256=kN5m3L5FzukHiSdlRAHSGIGpm9kk8FBcRZiHQimicP4,7192
|
|
8
8
|
typedal/for_py4web.py,sha256=KIIu8XgnAfRQCJfZCra79k8SInOHiFuLDKUv3hzTJng,1908
|
|
9
9
|
typedal/for_web2py.py,sha256=xn7zo6ImsmTkH6LacbjLQl2oqyBvP0zLqRxEJvMQk1w,1929
|
|
10
10
|
typedal/helpers.py,sha256=LpBgTwKmt9f1b4Mz98mxusvIHGiCpW_abDMZLP81g6Y,8850
|
|
@@ -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.14.
|
|
17
|
-
typedal-3.14.
|
|
18
|
-
typedal-3.14.
|
|
19
|
-
typedal-3.14.
|
|
16
|
+
typedal-3.14.2.dist-info/METADATA,sha256=CWdzLaTOMMBDjER1JnJDk1_ZneHznWNJHNFWBB2l668,10461
|
|
17
|
+
typedal-3.14.2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
18
|
+
typedal-3.14.2.dist-info/entry_points.txt,sha256=m1wqcc_10rHWPdlQ71zEkmJDADUAnZtn7Jac_6mbyUc,44
|
|
19
|
+
typedal-3.14.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|