djhtmx 1.2.0__tar.gz → 1.2.1__tar.gz

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.
Files changed (39) hide show
  1. {djhtmx-1.2.0 → djhtmx-1.2.1}/CHANGELOG.md +5 -0
  2. {djhtmx-1.2.0 → djhtmx-1.2.1}/PKG-INFO +1 -1
  3. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/__init__.py +1 -1
  4. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/introspection.py +9 -0
  5. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/utils.py +1 -0
  6. {djhtmx-1.2.0 → djhtmx-1.2.1}/.gitignore +0 -0
  7. {djhtmx-1.2.0 → djhtmx-1.2.1}/LICENSE +0 -0
  8. {djhtmx-1.2.0 → djhtmx-1.2.1}/MANIFEST.in +0 -0
  9. {djhtmx-1.2.0 → djhtmx-1.2.1}/README.md +0 -0
  10. {djhtmx-1.2.0 → djhtmx-1.2.1}/pyproject.toml +0 -0
  11. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/apps.py +0 -0
  12. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/command_queue.py +0 -0
  13. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/commands.py +0 -0
  14. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/component.py +0 -0
  15. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/consumer.py +0 -0
  16. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/context.py +0 -0
  17. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/exceptions.py +0 -0
  18. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/global_events.py +0 -0
  19. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/json.py +0 -0
  20. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/management/commands/htmx.py +0 -0
  21. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/middleware.py +0 -0
  22. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/query.py +0 -0
  23. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/repo.py +0 -0
  24. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/settings.py +0 -0
  25. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/static/htmx/2.0.4/ext/ws.js +0 -0
  26. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/static/htmx/2.0.4/htmx.amd.js +0 -0
  27. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/static/htmx/2.0.4/htmx.cjs.js +0 -0
  28. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/static/htmx/2.0.4/htmx.esm.d.ts +0 -0
  29. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/static/htmx/2.0.4/htmx.esm.js +0 -0
  30. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/static/htmx/2.0.4/htmx.js +0 -0
  31. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/static/htmx/2.0.4/htmx.min.js +0 -0
  32. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/static/htmx/django.js +0 -0
  33. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/templates/htmx/headers.html +0 -0
  34. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/templates/htmx/lazy.html +0 -0
  35. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/templatetags/__init__.py +0 -0
  36. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/templatetags/htmx.py +0 -0
  37. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/testing.py +0 -0
  38. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/tracing.py +0 -0
  39. {djhtmx-1.2.0 → djhtmx-1.2.1}/src/djhtmx/urls.py +0 -0
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.1] - 2025-10-01
11
+
12
+ ### Added
13
+ - **Literal Type Support in Query Objects**: Query objects can now use `Literal` type annotations for parameters. The introspection system now recognizes `Literal` types with simple values (str, int, float, bool, etc.) as basic types, enabling more precise type constraints in HTMX component queries.
14
+
10
15
  ## [1.2.0] - 2025-09-29
11
16
 
12
17
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: djhtmx
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Interactive UI Components for Django using HTMX
5
5
  Project-URL: Homepage, https://github.com/edelvalle/djhtmx
6
6
  Project-URL: Documentation, https://github.com/edelvalle/djhtmx#readme
@@ -1,4 +1,4 @@
1
1
  from .middleware import middleware
2
2
 
3
- __version__ = "1.2.0"
3
+ __version__ = "1.2.1"
4
4
  __all__ = ("middleware",)
@@ -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
 
@@ -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):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes