我正在使用谷歌应用引擎,我正在尝试使用代码插入实体/表:
class Tu(db.Model):
title = db.StringProperty(required=True)
presentation = db.TextProperty(required=True)
created = db.DateTimeProperty(auto_now_add=True)
last_modified = db.DateTimeProperty(auto_now=True)
. . .
a = Tu('teste', 'bla bla bla bla')
a.votes = 5
a.put()
但我收到此错误:
TypeError: Expected Model type; received teste (is str)
我正在关注此文档https://developers.google.com/appengine/docs/python/datastore/entities,但我看不出我错在哪里。