fh-pydantic-form 0.3.5__tar.gz → 0.3.6__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.
Potentially problematic release.
This version of fh-pydantic-form might be problematic. Click here for more details.
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/PKG-INFO +1 -1
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/RELEASE_NOTES.md +5 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/pyproject.toml +1 -1
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/form_renderer.py +14 -2
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/.github/workflows/build.yaml +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/.github/workflows/publish.yaml +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/.gitignore +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/.pre-commit-config.yaml +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/LICENSE +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/README.md +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/__init__.py +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/color_utils.py +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/comparison_form.py +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/constants.py +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/defaults.py +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/field_renderers.py +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/form_parser.py +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/list_path.py +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/py.typed +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/registry.py +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/type_helpers.py +0 -0
- {fh_pydantic_form-0.3.5 → fh_pydantic_form-0.3.6}/src/fh_pydantic_form/ui_style.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fh-pydantic-form
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.6
|
|
4
4
|
Summary: a library to turn any pydantic BaseModel object into a fasthtml/monsterui input form
|
|
5
5
|
Project-URL: Homepage, https://github.com/Marcura/fh-pydantic-form
|
|
6
6
|
Project-URL: Repository, https://github.com/Marcura/fh-pydantic-form
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Release Notes
|
|
2
2
|
|
|
3
|
+
## Version 0.3.6 (2025-07-21)
|
|
4
|
+
|
|
5
|
+
- **NEW**: can now pass new metrics_dict to `.with_initial_values()` helper method.
|
|
6
|
+
|
|
7
|
+
---
|
|
3
8
|
## Version 0.3.5 (2025-07-17)
|
|
4
9
|
|
|
5
10
|
- **NEW**: Added support for `decimal.Decimal` fields with dedicated field renderer
|
|
@@ -349,6 +349,13 @@ class PydanticForm(Generic[ModelType]):
|
|
|
349
349
|
for field_type, renderer_cls in custom_renderers:
|
|
350
350
|
registry.register_type_renderer(field_type, renderer_cls)
|
|
351
351
|
|
|
352
|
+
@property
|
|
353
|
+
def form_name(self) -> str:
|
|
354
|
+
"""
|
|
355
|
+
LLMs like to hallucinate this property, so might as well make it real.
|
|
356
|
+
"""
|
|
357
|
+
return self.name
|
|
358
|
+
|
|
352
359
|
def _compact_wrapper(self, inner: FT) -> FT:
|
|
353
360
|
"""
|
|
354
361
|
Wrap inner markup in a wrapper div.
|
|
@@ -364,7 +371,9 @@ class PydanticForm(Generic[ModelType]):
|
|
|
364
371
|
self.values_dict = self.initial_values_dict.copy()
|
|
365
372
|
|
|
366
373
|
def with_initial_values(
|
|
367
|
-
self,
|
|
374
|
+
self,
|
|
375
|
+
initial_values: Optional[Union[ModelType, Dict[str, Any]]] = None,
|
|
376
|
+
metrics_dict: Optional[Dict[str, Any]] = None,
|
|
368
377
|
) -> "PydanticForm":
|
|
369
378
|
"""
|
|
370
379
|
Create a new PydanticForm instance with the same configuration but different initial values.
|
|
@@ -376,6 +385,7 @@ class PydanticForm(Generic[ModelType]):
|
|
|
376
385
|
Args:
|
|
377
386
|
initial_values: New initial values as BaseModel instance or dict.
|
|
378
387
|
Same format as the constructor accepts.
|
|
388
|
+
metrics_dict: Optional metrics dictionary for field-level visual feedback
|
|
379
389
|
|
|
380
390
|
Returns:
|
|
381
391
|
A new PydanticForm instance with identical configuration but updated initial values
|
|
@@ -391,7 +401,9 @@ class PydanticForm(Generic[ModelType]):
|
|
|
391
401
|
label_colors=self.label_colors,
|
|
392
402
|
exclude_fields=self.exclude_fields,
|
|
393
403
|
spacing=self.spacing,
|
|
394
|
-
metrics_dict=
|
|
404
|
+
metrics_dict=metrics_dict
|
|
405
|
+
if metrics_dict is not None
|
|
406
|
+
else self.metrics_dict,
|
|
395
407
|
)
|
|
396
408
|
|
|
397
409
|
return clone
|
|
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
|