djhtmx 1.3.4__py3-none-any.whl → 1.3.6__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 CHANGED
@@ -1,4 +1,4 @@
1
1
  from .middleware import middleware
2
2
 
3
- __version__ = "1.3.4"
3
+ __version__ = "1.3.6"
4
4
  __all__ = ("middleware",)
@@ -290,6 +290,16 @@ class ClassNode(Node):
290
290
  class_names = [
291
291
  class_name.resolve(cast(Mapping[str, Any], context))
292
292
  for condition, class_name in self.condition_and_classes
293
- if condition.eval(context) # type: ignore
293
+ if self._eval_bool(condition.eval(context)) # type: ignore
294
294
  ]
295
- return format_html_attrs({"class": " ".join(class_names) or None})
295
+ return format_html_attrs({"class": " ".join(filter(None, class_names)) or None})
296
+
297
+ @staticmethod
298
+ def _eval_bool(value) -> bool | str:
299
+ # Convert string boolean representations to actual booleans (yesno filter behavior)
300
+ if isinstance(value, str):
301
+ if value == "True":
302
+ return True
303
+ elif value in ("False", "None"):
304
+ return False
305
+ return value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: djhtmx
3
- Version: 1.3.4
3
+ Version: 1.3.6
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
- djhtmx/__init__.py,sha256=mQgvMxtgLk8jKYzYLn1bhXKZ6f3YOzex0el1-J_A4w8,84
1
+ djhtmx/__init__.py,sha256=3PHFA44ypJPl5t6aEMzcNQcNGvvYIucrNLaKnVzTjEY,84
2
2
  djhtmx/apps.py,sha256=hAyjzmInEstxLY9k8Qn58LvNlezgQLx5_NqyVL1WwYs,323
3
3
  djhtmx/command_queue.py,sha256=LSUkb2YMRt1lDyOg6WP7PoHsObynec0B55JyFtcshT0,5090
4
4
  djhtmx/commands.py,sha256=UxXbARd4Teetjh_zjvAWgI2KNbvdETH-WrGf4qD9Xr8,1206
@@ -30,8 +30,8 @@ djhtmx/static/htmx/2.0.4/ext/ws.js,sha256=HwUYFqEZBvs7Tx0_O0Bi-Dcmg5UOMlbMdkJ2FW
30
30
  djhtmx/templates/htmx/headers.html,sha256=z7r9klwBDXDyjbHrzatZeHDvXB2DaZhgu55CFbbD3d4,159
31
31
  djhtmx/templates/htmx/lazy.html,sha256=LfAThtKmFj-lCUZ7JWF_sC1Y6XsIpEz8A3IgWASn-J8,52
32
32
  djhtmx/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- djhtmx/templatetags/htmx.py,sha256=-qFqz4T9mCJocG9XIIey81cCYwk07XUd_DMpxNdmbsM,8397
34
- djhtmx-1.3.4.dist-info/METADATA,sha256=2slsTxKtB7VvVAvU4PhlNV82_mk3L5vAZVodSWg07uw,33745
35
- djhtmx-1.3.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
36
- djhtmx-1.3.4.dist-info/licenses/LICENSE,sha256=kCi_iSBUGsRZInQn96w7LXYzjiRjZ8FXl6vP--mFRPk,1085
37
- djhtmx-1.3.4.dist-info/RECORD,,
33
+ djhtmx/templatetags/htmx.py,sha256=TLYKgqk6fIBVdzLYpFWhCxv9hkFXJBfaXNeanvcVmOo,8770
34
+ djhtmx-1.3.6.dist-info/METADATA,sha256=-TXkF8F0DzaZmQ95x-Ka-I5AiMnR_leocT_hs76z_oc,33745
35
+ djhtmx-1.3.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
36
+ djhtmx-1.3.6.dist-info/licenses/LICENSE,sha256=kCi_iSBUGsRZInQn96w7LXYzjiRjZ8FXl6vP--mFRPk,1085
37
+ djhtmx-1.3.6.dist-info/RECORD,,
File without changes