Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法筛选非节点参数-datastore-googleappengine-python_Python_Google App Engine_Google Cloud Datastore - Fatal编程技术网

无法筛选非节点参数-datastore-googleappengine-python

无法筛选非节点参数-datastore-googleappengine-python,python,google-app-engine,google-cloud-datastore,Python,Google App Engine,Google Cloud Datastore,我得到一个错误:无法过滤非节点参数;收到的“年龄>=” 我遵循的语法在 请告诉我如何解决这个问题。我终于在找到了答案 关于这方面的文档,请参见 模型类中定义的属性必须引用为ndb.GenericProperty()。 对于问题中提到的代码,过滤器语法应为: Class user(ndb.Model): def post(self): name = db.StringProperty() age = db.StringProperty() Class search(webapp

我得到一个错误:无法过滤非节点参数;收到的“年龄>=”

我遵循的语法在


请告诉我如何解决这个问题。

我终于在
找到了答案
关于这方面的文档,请参见

模型类中定义的属性必须引用为ndb.GenericProperty()。 对于问题中提到的代码,过滤器语法应为:

Class user(ndb.Model):
  def post(self):
    name = db.StringProperty()
    age = db.StringProperty()
Class search(webapp2.RequestHandler):
  def post(self):
    x = userData.query().filter("age >=",1)  #error points to this line
x = userData.query().filter(ndb.GenericProperty("age") >= 1).get()