以下のコード スニペットで、これら 2 行を実行しようとすると、次のエラーが表示されます:"BadRequestError: 等値フィルターを使用してプロパティでプロジェクションを使用できません"
myname = self.response.get('state')
qy1=db.GqlQuery(*SELECT name,phoneNumber,description,city,state FROM Table1 WHERE state =:1",myname)
この後、qy1 の i の結果セットを反復するための for ループがあります。私は以前に行ったことを行うか、state IN 'some string' を実行する必要があると言っていますが、それを変更すると、リストではないというエラーが表示されます。
何かアドバイス?
完全なスタック トレースは次のとおりです。
INFO 2013-03-23 14:12:08,756 dev_appserver.py:3103] "POST /sendNearByPlaces.html HTTP/1.1" 500 -
ERROR 2013-03-23 14:12:22,023 webapp2.py:1552] cannot use projection on a property with an equality filter
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1535, in __call__
rv = self.handle_exception(request, response, e)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1102, in __call__
return handler.dispatch()
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "C:\Users\defiant\Desktop\PythonServer\bar.py", line 368, in post
for i in qy1:
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\db\__init__.py", line 2326, in next
return self.__model_class.from_entity(self.__iterator.next())
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\datastore\datastore_query.py", line 2892, in next
next_batch = self.__batcher.next()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\datastore\datastore_query.py", line 2754, in next
return self.next_batch(self.AT_LEAST_ONE)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\datastore\datastore_query.py", line 2791, in next_batch
batch = self.__next_batch.get_result()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 604, in get_result
return self.__get_result_hook(self)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\datastore\datastore_query.py", line 2528, in __query_result_hook
self._batch_shared.conn.check_rpc_success(rpc)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\datastore\datastore_rpc.py", line 1224, in check_rpc_success
raise _ToDatastoreError(err)
BadRequestError: cannot use projection on a property with an equality filter
INFO 2013-03-23 14:12:22,075 dev_appserver.py:3103] "POST /sendNearByPlaces.html HTTP/1.1" 500 -