Skip to content

Commit 8278867

Browse files
committed
Merge branch '0.24' into auto-transpiling
2 parents 05c1242 + 32983d8 commit 8278867

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
- Adds support for optional fields to properly optional
2626
>>>>>>> 0.24
2727
28+
### Migration
29+
30+
#### Convert type of value from form fields before using it
31+
32+
To read a value from formFields where id is `name`,
33+
34+
Before:
35+
36+
```python
37+
# form_fields should be of type List[FormField]
38+
name: str | None = None
39+
for field in form_fields:
40+
if field.id == 'name':
41+
name = field.value
42+
```
43+
44+
After:
45+
46+
```python
47+
# form_fields should be of type List[FormField]
48+
name: str | None = None
49+
for field in form_fields:
50+
if field.id == 'name':
51+
# Check type to ensure it's of type string
52+
value_to_consume = field.value
53+
if not isinstance(value_to_consume, str):
54+
# Throw error
55+
raise ValueError('name needs to be a string')
56+
name = str(value_to_consume)
57+
```
58+
2859
## [0.24.2] - 2024-09-03
2960
- Makes optional input form fields truly optional instead of just being able to accept `""`.
3061

0 commit comments

Comments
 (0)