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
c89ad455
Commit
c89ad455
authored
Nov 26, 2014
by
Oleg Marshev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename convert.
parent
7464dc84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
notesapi/v1/views.py
+4
-4
No files found.
notesapi/v1/views.py
View file @
c89ad455
...
@@ -30,9 +30,9 @@ class AnnotationSearchView(APIView):
...
@@ -30,9 +30,9 @@ class AnnotationSearchView(APIView):
params
=
request
.
QUERY_PARAMS
.
dict
()
params
=
request
.
QUERY_PARAMS
.
dict
()
if
'offset'
in
params
:
if
'offset'
in
params
:
kwargs
[
'offset'
]
=
_convert_
str
(
params
.
pop
(
'offset'
))
kwargs
[
'offset'
]
=
_convert_
to_int
(
params
.
pop
(
'offset'
))
if
'limit'
in
params
:
if
'limit'
in
params
:
kwargs
[
'limit'
]
=
_convert_
str
(
params
.
pop
(
'limit'
))
kwargs
[
'limit'
]
=
_convert_
to_int
(
params
.
pop
(
'limit'
))
# All remaining parameters are considered searched fields.
# All remaining parameters are considered searched fields.
kwargs
[
'query'
]
=
params
kwargs
[
'query'
]
=
params
...
@@ -141,9 +141,9 @@ def _filter_input(annotation, fields):
...
@@ -141,9 +141,9 @@ def _filter_input(annotation, fields):
return
annotation
return
annotation
def
_convert_
str
(
value
,
default
=
None
):
def
_convert_
to_int
(
value
,
default
=
None
):
"""
"""
Convert given value to
string
.
Convert given value to
int
.
"""
"""
try
:
try
:
return
int
(
value
or
default
)
return
int
(
value
or
default
)
...
...
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