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 @@ -25,6 +25,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
25
25
- Adds support for optional fields to properly optional
26
26
>>>>>>> 0.24
27
27
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
+
28
59
## [ 0.24.2] - 2024-09-03
29
60
- Makes optional input form fields truly optional instead of just being able to accept ` "" ` .
30
61
You can’t perform that action at this time.
0 commit comments