File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ If you want to apply custom serialization logic to specific columns:
145145result = item.to_dict(serialize_columns = {
146146 ' password' : lambda v : ' ***' if v else None ,
147147 ' email' : lambda v : v.lower() if v else None ,
148- ' id' : lambda v : str (v) ,
148+ ' id' : str ,
149149})
150150
151151# Set default for all instances of a model
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ def test_serialize_columns_class_level(get_instance):
66
77 class ClassLevelCustomFlatModel (FlatModel ):
88 serialize_columns = {
9- "id" : lambda v : str ( v ) ,
9+ "id" : str ,
1010 "string" : lambda v : v .upper () if v else None ,
1111 }
1212
@@ -220,7 +220,7 @@ def test_serialize_columns_with_multiple_fields(get_instance):
220220
221221 data = i .to_dict (
222222 serialize_columns = {
223- "id" : lambda v : str ( v ) ,
223+ "id" : str ,
224224 "string" : lambda v : v .upper () if v else None ,
225225 "bool" : lambda v : "YES" if v else "NO" ,
226226 }
You can’t perform that action at this time.
0 commit comments