Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
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
django-rest-framework
Commits
24a2ec05
Commit
24a2ec05
authored
Feb 27, 2016
by
Xavier Ordoquy
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'reference/stable/3.3.x' into stable/3.3.3
parents
f5822e7b
a609e4e1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
5 deletions
+24
-5
docs/api-guide/relations.md
+1
-1
docs/tutorial/1-serialization.md
+1
-1
requirements/requirements-packaging.txt
+3
-0
rest_framework/pagination.py
+1
-1
setup.py
+16
-0
tests/test_pagination.py
+2
-2
No files found.
docs/api-guide/relations.md
View file @
24a2ec05
...
...
@@ -507,7 +507,7 @@ For example, given the following model for a tag, which has a generic relationsh
def __unicode__(self):
return self.tag_name
And the following two models, which may
be
have associated tags:
And the following two models, which may have associated tags:
class Bookmark(models.Model):
"""
...
...
docs/tutorial/1-serialization.md
View file @
24a2ec05
...
...
@@ -325,7 +325,7 @@ Quit out of the shell...
In another terminal window, we can test the server.
We can test our API using
using
[
curl
][
curl
]
or
[
httpie
][
httpie
]
. Httpie is a user friendly http client that's written in Python. Let's install that.
We can test our API using
[
curl
][
curl
]
or
[
httpie
][
httpie
]
. Httpie is a user friendly http client that's written in Python. Let's install that.
You can install httpie using pip:
...
...
requirements/requirements-packaging.txt
View file @
24a2ec05
...
...
@@ -6,3 +6,6 @@ twine==1.4.0
# Transifex client for managing translation resources.
transifex-client==0.11
# Pandoc to have a nice pypi page
pypandoc
rest_framework/pagination.py
View file @
24a2ec05
...
...
@@ -186,7 +186,7 @@ class PageNumberPagination(BasePagination):
template
=
'rest_framework/pagination/numbers.html'
invalid_page_message
=
_
(
'Invalid page
"{page_number}": {message}
.'
)
invalid_page_message
=
_
(
'Invalid page.'
)
def
paginate_queryset
(
self
,
queryset
,
request
,
view
=
None
):
"""
...
...
setup.py
View file @
24a2ec05
...
...
@@ -7,6 +7,17 @@ import sys
from
setuptools
import
setup
try
:
from
pypandoc
import
convert
def
read_md
(
f
):
return
convert
(
f
,
'rst'
)
except
ImportError
:
print
(
"warning: pypandoc module not found, could not convert Markdown to RST"
)
def
read_md
(
f
):
return
open
(
f
,
'r'
)
.
read
()
def
get_version
(
package
):
"""
...
...
@@ -45,6 +56,10 @@ version = get_version('rest_framework')
if
sys
.
argv
[
-
1
]
==
'publish'
:
try
:
import
pypandoc
except
ImportError
:
print
(
"pypandoc not installed.
\n
Use `pip install pypandoc`.
\n
Exiting."
)
if
os
.
system
(
"pip freeze | grep wheel"
):
print
(
"wheel not installed.
\n
Use `pip install wheel`.
\n
Exiting."
)
sys
.
exit
()
...
...
@@ -68,6 +83,7 @@ setup(
url
=
'http://www.django-rest-framework.org'
,
license
=
'BSD'
,
description
=
'Web APIs for Django, made easy.'
,
long_description
=
read_md
(
'README.md'
),
author
=
'Tom Christie'
,
author_email
=
'tom@tomchristie.com'
,
# SEE NOTE BELOW (*)
packages
=
get_packages
(
'rest_framework'
),
...
...
tests/test_pagination.py
View file @
24a2ec05
...
...
@@ -113,7 +113,7 @@ class TestPaginationIntegration:
response
=
self
.
view
(
request
)
assert
response
.
status_code
==
status
.
HTTP_404_NOT_FOUND
assert
response
.
data
==
{
'detail'
:
'Invalid page
"0": That page number is less than 1
.'
'detail'
:
'Invalid page.'
}
def
test_404_not_found_for_invalid_page
(
self
):
...
...
@@ -121,7 +121,7 @@ class TestPaginationIntegration:
response
=
self
.
view
(
request
)
assert
response
.
status_code
==
status
.
HTTP_404_NOT_FOUND
assert
response
.
data
==
{
'detail'
:
'Invalid page
"invalid": That page number is not an integer
.'
'detail'
:
'Invalid page.'
}
...
...
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