def search(self, query_string, sort='title'):
        # TODO: Someday, replace this with something like Sphinx or another real
        # search engine
        strip_qs = query_string.strip()
        if not strip_qs:
            return self.all_sorted(sort).order_by('-modified')
        else:
            query = self._get_query(strip_qs, self.search_fields)
            return self.all_sorted(sort).filter(query).order_by('-modified')
Quick and dirty keyword search on submissions
dataset/ETHPy150Open mozilla/django-badger/badger/models.py/SearchManagerMixin.search