开发者

List of floats on the google appengine

开发者 https://www.devze.com 2023-01-16 23:41 出处:网络
Been hunting for an hour or so. It would appear that db.Float does not exist. Is there any way to store a list of floats in a ListProperty? Here\'s the basic idea:

Been hunting for an hour or so. It would appear that db.Float does not exist. Is there any way to store a list of floats in a ListProperty? Here's the basic idea:

class Data(db.Model):
    temperatures = db.ListProperty(item_type=???)

Tha开发者_StackOverflow中文版nks in advance.


There is a FloatProperty but that has nothing to do with ListProperty's first argument, which, and I quote, is just "a Python type or class" (and float is explicitly listed here as a perfectly OK value type, too). IOW,

temperatures = db.ListProperty(float)

should work just fine (float is a Python built-in identifier, of course). What problems are you seeing when you do that?

0

精彩评论

暂无评论...
验证码 换一张
取 消