I am trying to learn simple operations with the datastore and I am having problems. Can someone help why this is not working?
class Pet(db.Model):
name = db.StringProperty
pet = Pet(name="Fl开发者_JAVA百科uffy")
pet.put()
query = Pet.all()
results = query.fetch(limit=5)
print pet.name
When I run this I get
<class 'google.appengine.ext.db.StringProperty'>
Try changing
name = db.StringProperty
to
name = db.StringProperty()
精彩评论