Commit a7b3f092 by Tim Babych

pep8

parent 8d8df6de
from haystack import indexes from haystack import indexes
from .models import Note from .models import Note
class NoteIndex(indexes.SearchIndex, indexes.Indexable): class NoteIndex(indexes.SearchIndex, indexes.Indexable):
user = indexes.CharField(model_attr='user_id', indexed=False) user = indexes.CharField(model_attr='user_id', indexed=False)
course_id = indexes.CharField(model_attr='course_id', indexed=False) course_id = indexes.CharField(model_attr='course_id', indexed=False)
......
...@@ -433,9 +433,7 @@ class AnnotationViewTests(BaseAnnotationViewTests): ...@@ -433,9 +433,7 @@ class AnnotationViewTests(BaseAnnotationViewTests):
Tests list all annotations. Tests list all annotations.
""" """
for i in xrange(5): for i in xrange(5):
kwargs = {'text': 'Foo_{}'.format(i), kwargs = {'text': 'Foo_{}'.format(i)}
}
self._create_annotation(**kwargs) self._create_annotation(**kwargs)
url = reverse('api:v1:annotations') url = reverse('api:v1:annotations')
......
...@@ -25,7 +25,7 @@ class AnnotationSearchView(APIView): ...@@ -25,7 +25,7 @@ class AnnotationSearchView(APIView):
""" """
params = self.request.QUERY_PARAMS.dict() params = self.request.QUERY_PARAMS.dict()
query = SearchQuerySet().models(Note).filter( query = SearchQuerySet().models(Note).filter(
**{f:v for (f,v) in params.items() if f in ('user', 'course_id', 'usage_id', 'text')} **{f: v for (f, v) in params.items() if f in ('user', 'course_id', 'usage_id', 'text')}
).order_by('-updated') ).order_by('-updated')
if params.get('highlight'): if params.get('highlight'):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment