Google app engine 在google appengine中选择_Key u
我有这个型号Google app engine 在google appengine中选择_Key u,google-app-engine,gql,Google App Engine,Gql,我有这个型号 from google.appengine.ext import db class Question(db.Model): Qtitle = db.StringProperty() Q= FirstModel(Qtitle="Who is the most handsome actor?") Q.put() 然后我运行这个GQL查询: query = db.GqlQuery("SELECT __key__ FROM FirstModel Qtitle='Who is
from google.appengine.ext import db
class Question(db.Model):
Qtitle = db.StringProperty()
Q= FirstModel(Qtitle="Who is the most handsome actor?")
Q.put()
然后我运行这个GQL查询:
query = db.GqlQuery("SELECT __key__ FROM FirstModel Qtitle='Who is the most handsome actor?' ")
results = query.fetch(10)
for result in results:
print result
但是有错误 我看到两个错误:
Question
,而不是FirstModel
WHERE
子句Try this , or something like that
from google.appengine.ext import db
class Question(db.Model):
Qtitle = db.StringProperty()
Q= Question(Qtitle="Who is the most handsome actor?")
Q.put()
query = db.GqlQuery('SELECT __key__ FROM Question where Qtitle = :qes' , qes='Who is the most handsome actor?').fetch(1)
for result in query
print result