数据存储列表 [英] Datastore list of lists

查看:80
本文介绍了数据存储列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个包含列表的列表属性,如:
db.ListProperty(list(str))

我知道列表str)不是支持的值类型,所以我想象我收到了一个ValueError异常。
想想也许有一个创造性的想法可以解决这个问题:)

谢谢!


I need to make a list property that will contain lists, something like: db.ListProperty(list(str))

I know list(str) is not a supported value type so as I imagined I received a "ValueError" exception. Thought maybe there is a creative idea out there of how to overcome this :)

Thanks!

解决方案

You could use pickle to serialize your list and store it in a BlobProperty field.

这篇关于数据存储列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆