def _add_filter(self, field, op, value):
        for query in self.gae_query:

            # GAE uses a special property name for primary key filters.
            if field.primary_key:
                column = '__key__'
            else:
                column = field.column
            key = '%s %s' % (column, op)

            if isinstance(value, Text):
                raise DatabaseError("TextField is not indexed, by default, "
                                    "so you can't filter on it. Please add "
                                    "an index definition for the field %s "
                                    "on the model %s.%s as described here:\n"
                                    "http://www.allbuttonspressed.com/blog/django/2010/07/Managing-per-field-indexes-on-App-Engine" %
                                    (column, self.query.model.__module__,
                                     self.query.model.__name__))
            if key in query:
                existing_value = query[key]
                if isinstance(existing_value, list):
                    existing_value.append(value)
                else:
                    query[key] = [existing_value, value]
            else:
                query[key] = value