Skip to content

Commit

Permalink
Corrected how query terms are found, for Django 1.5 compatibility. Th…
Browse files Browse the repository at this point in the history
…anks to maraujop for the original patch!
  • Loading branch information
toastdriven committed Aug 14, 2012
1 parent a5456df commit 5397dec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tastypie/resources.py
Expand Up @@ -1733,7 +1733,12 @@ def build_filters(self, filters=None):

if hasattr(self._meta, 'queryset'):
# Get the possible query terms from the current QuerySet.
query_terms = self._meta.queryset.query.query_terms.keys()
if hasattr(self._meta.queryset.query.query_terms, 'keys'):
# Django 1.4 & below compatibility.
query_terms = self._meta.queryset.query.query_terms.keys()
else:
# Django 1.5+.
query_terms = self._meta.queryset.query.query_terms
else:
query_terms = QUERY_TERMS.keys()

Expand Down

0 comments on commit 5397dec

Please sign in to comment.