djhtmx 1.2.0__py3-none-any.whl → 1.2.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.
- djhtmx/__init__.py +1 -1
- djhtmx/introspection.py +9 -0
- djhtmx/utils.py +1 -0
- {djhtmx-1.2.0.dist-info → djhtmx-1.2.1.dist-info}/METADATA +1 -1
- {djhtmx-1.2.0.dist-info → djhtmx-1.2.1.dist-info}/RECORD +7 -7
- {djhtmx-1.2.0.dist-info → djhtmx-1.2.1.dist-info}/WHEEL +0 -0
- {djhtmx-1.2.0.dist-info → djhtmx-1.2.1.dist-info}/licenses/LICENSE +0 -0
djhtmx/__init__.py
CHANGED
djhtmx/introspection.py
CHANGED
|
@@ -13,6 +13,7 @@ from typing import (
|
|
|
13
13
|
Annotated,
|
|
14
14
|
Any,
|
|
15
15
|
Generic,
|
|
16
|
+
Literal,
|
|
16
17
|
TypedDict,
|
|
17
18
|
TypeVar,
|
|
18
19
|
Union,
|
|
@@ -381,6 +382,11 @@ infallible_bool_adapter = TypeAdapter(
|
|
|
381
382
|
)
|
|
382
383
|
|
|
383
384
|
|
|
385
|
+
def is_literal_annotation(ann):
|
|
386
|
+
"""Returns True if the annotation is a Literal type with simple values."""
|
|
387
|
+
return get_origin(ann) is Literal and all(type(arg) in _SIMPLE_TYPES for arg in get_args(ann))
|
|
388
|
+
|
|
389
|
+
|
|
384
390
|
def is_basic_type(ann):
|
|
385
391
|
"""Returns True if the annotation is a simple type.
|
|
386
392
|
|
|
@@ -395,6 +401,8 @@ def is_basic_type(ann):
|
|
|
395
401
|
|
|
396
402
|
- Instances of dict, tuple, list or set
|
|
397
403
|
|
|
404
|
+
- Literal types with simple values
|
|
405
|
+
|
|
398
406
|
"""
|
|
399
407
|
return (
|
|
400
408
|
ann in _SIMPLE_TYPES
|
|
@@ -402,6 +410,7 @@ def is_basic_type(ann):
|
|
|
402
410
|
or issubclass_safe(getattr(ann, "__origin__", None), models.Model)
|
|
403
411
|
or issubclass_safe(ann, (enum.IntEnum, enum.StrEnum))
|
|
404
412
|
or is_collection_annotation(ann)
|
|
413
|
+
or is_literal_annotation(ann)
|
|
405
414
|
)
|
|
406
415
|
|
|
407
416
|
|
djhtmx/utils.py
CHANGED
|
@@ -129,6 +129,7 @@ def autodiscover_htmx_modules():
|
|
|
129
129
|
- htmx.py files (like standard autodiscover_modules("htmx"))
|
|
130
130
|
- All Python files under htmx/ directories in apps (recursively)
|
|
131
131
|
"""
|
|
132
|
+
|
|
132
133
|
def _import_modules_recursively(module_name):
|
|
133
134
|
"""Recursively import a module and all its submodules."""
|
|
134
135
|
with contextlib.suppress(ImportError):
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
djhtmx/__init__.py,sha256=
|
|
1
|
+
djhtmx/__init__.py,sha256=ADstIQLho1ikMNCKiMEwgQdR5tM1cP5NiOy3Lpn1cq8,84
|
|
2
2
|
djhtmx/apps.py,sha256=hAyjzmInEstxLY9k8Qn58LvNlezgQLx5_NqyVL1WwYs,323
|
|
3
3
|
djhtmx/command_queue.py,sha256=kiYbQFPyjnhMSR7KgO1Nu-lWiapnH511P2Pyg-Zrdq4,4862
|
|
4
4
|
djhtmx/commands.py,sha256=UxXbARd4Teetjh_zjvAWgI2KNbvdETH-WrGf4qD9Xr8,1206
|
|
@@ -7,7 +7,7 @@ djhtmx/consumer.py,sha256=kHNoXokcWaFjs5zbZAhM7Y0x7GVwwawXbxBCkP8HNA8,2839
|
|
|
7
7
|
djhtmx/context.py,sha256=cWvz8Z0MC6x_G8sn5mvoH8Hu38qReY21_eNdThuba1A,214
|
|
8
8
|
djhtmx/exceptions.py,sha256=UtyE1N-52OmzwgRM9xFxjUuhHTMDvD7Oy3rNpgthLcs,47
|
|
9
9
|
djhtmx/global_events.py,sha256=bYb8WmQn_WsZ_Dadr0pGiGOPia01K-VanPpM97Lt324,342
|
|
10
|
-
djhtmx/introspection.py,sha256=
|
|
10
|
+
djhtmx/introspection.py,sha256=flVolO6xZiXsxMm876ZCEcWRmVfFsJWpAVmIdfcJNf8,13734
|
|
11
11
|
djhtmx/json.py,sha256=7cjwWIJj7e0dk54INKYZJe6zKkIW7wlsNSlD05cbXfY,1374
|
|
12
12
|
djhtmx/middleware.py,sha256=JuMtv9ZnpungTvQ1qD2Lg6LiFPB3knQlA1ERgH4iGl0,1274
|
|
13
13
|
djhtmx/query.py,sha256=UyjN1jokh4wTwQJxcRwA9f-Zn-A7A4GLToeGrCnPhKA,6674
|
|
@@ -16,7 +16,7 @@ djhtmx/settings.py,sha256=ymFUMvrcXDkYU9KkhPOjRZSQMWz5GcUjlgh07x09-1s,1242
|
|
|
16
16
|
djhtmx/testing.py,sha256=AdZKsT6sNTsyqSKx6EmfthOIHzSAPkTquheMfg9znbk,8301
|
|
17
17
|
djhtmx/tracing.py,sha256=xkCXb7t_3yCj1PGzmQfHPu9sYQftDKwtALaEbFVnQ1E,1260
|
|
18
18
|
djhtmx/urls.py,sha256=zWMlw_udCUWvo5DNxsvbebSNRFxy0C9ghBmRg08XlcU,3894
|
|
19
|
-
djhtmx/utils.py,sha256=
|
|
19
|
+
djhtmx/utils.py,sha256=BcCdJHe0AqkRT_Kj-XJT_sHCpOyXtumo9mQGN2WqHek,4646
|
|
20
20
|
djhtmx/management/commands/htmx.py,sha256=tEtiJn_Z6byOFzBNIzTbdluA4T5q21zFwGvJ7yt90bw,3642
|
|
21
21
|
djhtmx/static/htmx/django.js,sha256=G59uwy5hA4QUcAFJv21SMxizATpNZG3KfgFlO2zXeGc,7086
|
|
22
22
|
djhtmx/static/htmx/2.0.4/htmx.amd.js,sha256=Hgmm_X5zw7ek0pjBaxhzH7OHx6Xfce5UYVa9ICWlWR0,165593
|
|
@@ -30,7 +30,7 @@ djhtmx/templates/htmx/headers.html,sha256=rBQTBt9rnlxE8lgxN4U7nvzQZNw4JZKS4flD1V
|
|
|
30
30
|
djhtmx/templates/htmx/lazy.html,sha256=LfAThtKmFj-lCUZ7JWF_sC1Y6XsIpEz8A3IgWASn-J8,52
|
|
31
31
|
djhtmx/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
32
|
djhtmx/templatetags/htmx.py,sha256=HlH7_B9lJoTDoIkYPeEE55OwpBTrrCesE70j1KcRC70,8063
|
|
33
|
-
djhtmx-1.2.
|
|
34
|
-
djhtmx-1.2.
|
|
35
|
-
djhtmx-1.2.
|
|
36
|
-
djhtmx-1.2.
|
|
33
|
+
djhtmx-1.2.1.dist-info/METADATA,sha256=11WVimnQxDR07_6WtvEqxP0oeEQYdLrer3vOaYpVpOM,32245
|
|
34
|
+
djhtmx-1.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
35
|
+
djhtmx-1.2.1.dist-info/licenses/LICENSE,sha256=kCi_iSBUGsRZInQn96w7LXYzjiRjZ8FXl6vP--mFRPk,1085
|
|
36
|
+
djhtmx-1.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|