Problem
When running
from google.appengine.ext import db from data.citeseerx import Record query = db.Query(Record) #query.filter('identifier =', 'oai:CiteSeerXPSU:10.1.1.1.1494') query.filter('ID =', '5') #results = query.fetch() print "hi"
The following error occurs
Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/__init__.py", line 205, in post exec(compiled_code, globals()) File "<string>", line 6, in <module> File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/db/__init__.py", line 1667, in filter if prop in self._model_class._unindexed_properties: AttributeError: 'module' object has no attribute '_unindexed_properties'
Reason
The field is not indexed in db
Or to be more precise for some reason is not read through Query interface; how it is being read through GQL interface
Solution
Add needed index -- does not work
Run query through GQL interface; e.g.:
from google.appengine.ext import db from data.citeseerx import Record #""" #query = db.GqlQuery("SELECT * FROM Record " + "WHERE identifier = :1", "oai:CiteSeerXPSU:10.1.1.1.1494") query = db.GqlQuery("SELECT * FROM Record " + "WHERE creator_id_list = :1", "Gokul Varadhan") #""" """ query = db.Query(Record) query.filter("identifier =", "oai:CiteSeerXPSU:10.1.1.1.1494") #query.filter('ID =', '5') """ results = query.fetch(5) for r in results: print r print "fin"