在下面的代碼片段中,當我嘗試執行這兩行時,出現此錯誤:「 BadRequestError:不能在具有相等過濾器的屬性上使用投影「BadRequestError:無法在屬性上使用等值過濾器投影
myname = self.response.get('state')
QY1 = db.GqlQuery(* SELECT名字,phoneNumber的,說明,城市,州FROM表1 WHERE狀態= 1」,MYNAME)
我有一個循環後,這個迭代通過結果集 爲我在qy1: (做一些JSON轉儲) 現在狀態字段是一個StringProperty,甚至做str(myname)會得到相同的結果。我一直在尋找他們說你應該做我以前做過的事情,或者做一些'字符串'的狀態,但是如果我改變它,我會得到一個關於它不是列表的錯誤。
有什麼建議嗎?
完整的堆棧跟蹤是:
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 -
請張貼異常的完整堆棧跟蹤,我有一種感覺,它不是失敗,你的事情失敗。 – 2013-03-23 14:01:19
我已經添加了堆棧跟蹤。 – user2202316 2013-03-23 14:18:46
'SELECT * FROM'不是投影查詢。你在使用'SELECT propertyName FROM'的地方發生錯誤嗎? – 2013-03-23 17:53:22