fasthx 2.3.1__tar.gz → 2.3.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: fasthx
3
- Version: 2.3.1
3
+ Version: 2.3.2
4
4
  Summary: FastAPI server-side rendering with built-in HTMX support.
5
5
  License: MIT
6
6
  Author: Peter Volf
@@ -70,8 +70,12 @@ class JinjaContext:
70
70
  if hasattr(obj, "__dict__"):
71
71
  # Covers Pydantic models and standard classes.
72
72
  object_keys = obj.__dict__.keys()
73
- if hasattr(obj, "model_computed_fields"): # Pydantic computed fields support.
74
- object_keys = [*(() if object_keys is None else object_keys), *obj.model_computed_fields]
73
+ cls = type(obj)
74
+ if hasattr(cls, "model_computed_fields"): # Pydantic computed fields support.
75
+ object_keys = [
76
+ *(() if object_keys is None else object_keys),
77
+ *cls.model_computed_fields,
78
+ ]
75
79
  elif hasattr(obj, "__slots__"):
76
80
  # Covers classes with with __slots__.
77
81
  object_keys = obj.__slots__
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "fasthx"
3
- version = "2.3.1"
3
+ version = "2.3.2"
4
4
  description = "FastAPI server-side rendering with built-in HTMX support."
5
5
  authors = ["Peter Volf <do.volfp@gmail.com>"]
6
6
  readme = "README.md"
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