标签: python string google-app-engine properties option
class FirstModel(db.Model): p = db.StringProperty({option:['aa','bb','cc']})
错误是:
NameError: name 'option' is not defined
我该怎么办?
答案 0 :(得分:3)
您应该使用:
p = db.StringProperty(choices=set(["aa", "bb", "cc"]))