Created
September 18, 2011 01:40
-
-
Save myusuf3/1224577 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from haystack.query import SearchQuerySet | |
class MyResource(Resource): | |
def build_filters(self, filters=None): | |
if filters is None: | |
filters = {} | |
orm_filters = super(MyResource, self).build_filters(filters) | |
if "q" in filters: | |
sqs = SearchQuerySet().auto_query(filters['q']) | |
orm_filters = {"pk__in": [ i.pk for i in sqs ]} | |
return orm_filters |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment