File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -155,8 +155,7 @@ def from_obj(cls, cls_obj=None):
155
155
elif issubclass (field .type_ , Entity ):
156
156
val = field .type_ .from_obj (val )
157
157
else :
158
- #TODO: fix this
159
- val = field .type_ .make (val )
158
+ val = field .type_ (val )
160
159
setattr (entity , field .attr_name , val )
161
160
162
161
return entity
@@ -189,7 +188,7 @@ def from_dict(cls, cls_dict=None):
189
188
val = field .type_ .from_dict (val )
190
189
else :
191
190
#TODO: fix this
192
- val = field .type_ . make (val )
191
+ val = field .type_ (val )
193
192
setattr (entity , field .attr_name , val )
194
193
195
194
return entity
Original file line number Diff line number Diff line change 1
1
class _type_base (object ):
2
2
"""A base class for all of these types"""
3
3
4
- # TODO: get this working with python magic __new__ or __init__
5
- @ classmethod
6
- def make (cls , val ):
4
+ _try_cast = True
5
+
6
+ def __new__ (cls , val ):
7
7
if val is None :
8
8
return None
9
9
return cls ._pytype (val )
You can’t perform that action at this time.
0 commit comments