def decode_list_property(obj, prop, value):
if value is None:
return []
# there is an issue with large ints and ListProperty(int) AMF leaves
# ints > amf3.MAX_29B_INT as floats db.ListProperty complains pretty
# hard in this case so we try to work around the issue.
if prop.item_type in (int, long):
for i, x in enumerate(value):
if isinstance(x, float):
y = int(x)
# only convert the type if there is no mantissa
# otherwise let the chips fall where they may
if x == y:
value[i] = y
return value
_google_appengine_ext_db.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录