Please help me understand this:
On v1.6.6 it’s in line 2744 of google/appengine/ext/db/__init__.py:
class UnindexedProperty(Property):
"""A property that isn't indexed by either built-in or composite indices.
TextProperty and BlobProperty derive from this class.
"""
def __init__(self, *args, **kwds):
"""Construct property. See the Property class for details.
Raises:
ConfigurationError if indexed=True.
"""
self._require_parameter(kwds, 'indexed', False)
kwds['indexed'] = True
super(UnindexedProperty, self).__init__(*args, **kwds)
.
.
.
After they constrained the indexed parameter to be False – They set it to True!
Before 1.2.2, you could do filter queries for any property type, even Text and Blob. They did only return empty lists, but it worked. Version 1.2.2 introduced the
indexedattribute for properties which allows you to disable indexing of selected properties[1]. Since then, the property you want to query on must be indexed or it will throw an exception.We know that Text and Blob properties can not be indexed. Not changing anything else, queries on those properties would be raising exceptions from 1.2.2 on (which they didn’t before). In order to not introduce a regression and break existing apps, the line
kwds['indexed'] = Truewas added to theUnindexedPropertyclass.If we would have control over all the depending code, it would have been a cleaner solution to start raising an exception. But in the light of not breaking existing apps, it was decided to patch it.
You can try it yourself by changing
kwds['indexed'] = Truetokwds['indexed'] = Falseand run this snippet:[1] http://code.google.com/p/googleappengine/source/browse/trunk/python/RELEASE_NOTES#1165