Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-notes-api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-notes-api
Commits
a7b3f092
Commit
a7b3f092
authored
Jan 05, 2015
by
Tim Babych
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pep8
parent
8d8df6de
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
4 deletions
+3
-4
notesapi/v1/search_indexes.py
+1
-0
notesapi/v1/tests/test_models.py
+0
-0
notesapi/v1/tests/test_views.py
+1
-3
notesapi/v1/views.py
+1
-1
notesserver/settings/logger.py
+0
-0
No files found.
notesapi/v1/search_indexes.py
View file @
a7b3f092
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
)
...
...
notesapi/v1/tests/test_models.py
View file @
a7b3f092
notesapi/v1/tests/test_views.py
View file @
a7b3f092
...
@@ -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'
)
...
...
notesapi/v1/views.py
View file @
a7b3f092
...
@@ -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'
):
...
...
notesserver/settings/logger.py
View file @
a7b3f092
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment