File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
- Adds support for form field related improvements by making fields accept any type of values
14
14
- Adds support for optional fields to properly optional
15
15
16
+ ### Migration
17
+
18
+ #### Convert type of value from form fields before using it
19
+
20
+ To read a value from formFields where id is ` name ` ,
21
+
22
+ Before:
23
+
24
+ ``` python
25
+ # form_fields should be of type List[FormField]
26
+ name: str | None = None
27
+ for field in form_fields:
28
+ if field.id == ' name' :
29
+ name = field.value
30
+ ```
31
+
32
+ After:
33
+
34
+ ``` python
35
+ # form_fields should be of type List[FormField]
36
+ name: str | None = None
37
+ for field in form_fields:
38
+ if field.id == ' name' :
39
+ # Check type to ensure it's of type string
40
+ value_to_consume = field.value
41
+ if not isinstance (value_to_consume, str ):
42
+ # Throw error
43
+ raise ValueError (' name needs to be a string' )
44
+ name = str (value_to_consume)
45
+ ```
46
+
16
47
## [ 0.24.2] - 2024-09-03
17
48
- Makes optional input form fields truly optional instead of just being able to accept ` "" ` .
18
49
You can’t perform that action at this time.
0 commit comments