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
e87f07dd
Commit
e87f07dd
authored
Dec 31, 2014
by
Tim Babych
Committed by
Oleg Marshev
Jan 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
specify ElastiUtils more precisely, add docstrings
parent
009faa10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
notesapi/v1/models.py
+12
-4
requirements/base.txt
+1
-1
No files found.
notesapi/v1/models.py
View file @
e87f07dd
...
...
@@ -11,12 +11,12 @@ class Note(models.Model):
"""
Annotation model.
"""
user_id
=
models
.
CharField
(
max_length
=
255
)
user_id
=
models
.
CharField
(
max_length
=
255
,
help_text
=
"Anonymized user id, not course specific"
)
course_id
=
models
.
CharField
(
max_length
=
255
)
usage_id
=
models
.
CharField
(
max_length
=
255
)
text
=
models
.
TextField
(
default
=
""
)
usage_id
=
models
.
CharField
(
max_length
=
255
,
help_text
=
"ID of XBlock where the text comes from"
)
quote
=
models
.
TextField
(
default
=
""
)
ranges
=
models
.
TextField
(
default
=
""
)
text
=
models
.
TextField
(
default
=
""
,
help_text
=
"Student's thoughts on the quote"
)
ranges
=
models
.
TextField
(
default
=
""
,
help_text
=
"JSON, describes position of quote in the source text"
)
created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
updated
=
models
.
DateTimeField
(
auto_now
=
True
)
...
...
@@ -122,9 +122,17 @@ class NoteMappingType(MappingType, Indexable):
@staticmethod
def
process_result
(
data
):
"""
<<<<<<< HEAD
Prepares result for response.
Also prepares ranges field and highlighting.
=======
Unlistifies the result and replaces `text` with highlihted one
Unlistification: ElasticUtils returns data as [{field:value,..}..] which is not what needed.
this function reverses the effect to get the original value.
Also filed https://github.com/mozilla/elasticutils/pull/285 to make it unnecessary.
>>>>>>> specify ElastiUtils more precisely, add docstrings
"""
for
i
,
item
in
enumerate
(
data
):
if
isinstance
(
item
,
dict
):
...
...
requirements/base.txt
View file @
e87f07dd
...
...
@@ -2,7 +2,7 @@ Django==1.7.1
requests==2.4.3
djangorestframework==3.0.2
django-rest-swagger==0.2.0
elasticutils==0.10
elasticutils==0.10
.2
elasticsearch==1.2.0
django-cors-headers==0.13
PyJWT==0.3.0
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