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
e441f851
Commit
e441f851
authored
Sep 25, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop 1.3 support
parent
21cd6386
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
37 additions
and
144 deletions
+37
-144
.travis.yml
+2
-10
rest_framework/authentication.py
+1
-1
rest_framework/compat.py
+0
-0
rest_framework/fields.py
+3
-1
rest_framework/routers.py
+1
-1
rest_framework/runtests/settings.py
+1
-4
rest_framework/runtests/urls.py
+1
-1
rest_framework/serializers.py
+3
-3
rest_framework/templates/rest_framework/base.html
+1
-0
rest_framework/templates/rest_framework/login_base.html
+1
-0
rest_framework/templatetags/rest_framework.py
+2
-85
rest_framework/tests/test_authentication.py
+1
-1
rest_framework/tests/test_breadcrumbs.py
+1
-1
rest_framework/tests/test_filters.py
+2
-1
rest_framework/tests/test_htmlrenderer.py
+1
-1
rest_framework/tests/test_hyperlinkedserializers.py
+2
-2
rest_framework/tests/test_relations_hyperlink.py
+1
-1
rest_framework/tests/test_renderers.py
+2
-1
rest_framework/tests/test_request.py
+1
-1
rest_framework/tests/test_response.py
+1
-1
rest_framework/tests/test_reverse.py
+1
-1
rest_framework/tests/test_routers.py
+1
-1
rest_framework/tests/test_testing.py
+1
-1
rest_framework/tests/test_urlpatterns.py
+1
-1
rest_framework/urlpatterns.py
+1
-1
rest_framework/urls.py
+1
-1
rest_framework/utils/encoders.py
+2
-1
tox.ini
+1
-21
No files found.
.travis.yml
View file @
e441f851
...
@@ -10,18 +10,15 @@ env:
...
@@ -10,18 +10,15 @@ env:
-
DJANGO="https://www.djangoproject.com/download/1.6a1/tarball/"
-
DJANGO="https://www.djangoproject.com/download/1.6a1/tarball/"
-
DJANGO="django==1.5.1 --use-mirrors"
-
DJANGO="django==1.5.1 --use-mirrors"
-
DJANGO="django==1.4.5 --use-mirrors"
-
DJANGO="django==1.4.5 --use-mirrors"
-
DJANGO="django==1.3.7 --use-mirrors"
install
:
install
:
-
pip install $DJANGO
-
pip install $DJANGO
-
pip install defusedxml==0.3
-
pip install defusedxml==0.3 --use-mirrors
-
pip install django-filter==0.6 --use-mirrors
-
"
if
[[
${TRAVIS_PYTHON_VERSION::1}
!=
'3'
]];
then
pip
install
oauth2==1.5.211
--use-mirrors;
fi"
-
"
if
[[
${TRAVIS_PYTHON_VERSION::1}
!=
'3'
]];
then
pip
install
oauth2==1.5.211
--use-mirrors;
fi"
-
"
if
[[
${TRAVIS_PYTHON_VERSION::1}
!=
'3'
]];
then
pip
install
django-oauth-plus==2.0
--use-mirrors;
fi"
-
"
if
[[
${TRAVIS_PYTHON_VERSION::1}
!=
'3'
]];
then
pip
install
django-oauth-plus==2.0
--use-mirrors;
fi"
-
"
if
[[
${TRAVIS_PYTHON_VERSION::1}
!=
'3'
]];
then
pip
install
django-oauth2-provider==0.2.4
--use-mirrors;
fi"
-
"
if
[[
${TRAVIS_PYTHON_VERSION::1}
!=
'3'
]];
then
pip
install
django-oauth2-provider==0.2.4
--use-mirrors;
fi"
-
"
if
[[
${TRAVIS_PYTHON_VERSION::1}
!=
'3'
]];
then
pip
install
django-guardian==1.1.1
--use-mirrors;
fi"
-
"
if
[[
${TRAVIS_PYTHON_VERSION::1}
!=
'3'
]];
then
pip
install
django-guardian==1.1.1
--use-mirrors;
fi"
-
"
if
[[
${DJANGO::11}
==
'django==1.3'
]];
then
pip
install
django-filter==0.5.4
--use-mirrors;
fi"
-
"
if
[[
${DJANGO::11}
==
'django==1.3'
]];
then
pip
install
six
--use-mirrors;
fi"
-
"
if
[[
${DJANGO::11}
!=
'django==1.3'
]];
then
pip
install
django-filter==0.6
--use-mirrors;
fi"
-
export PYTHONPATH=.
-
export PYTHONPATH=.
script
:
script
:
...
@@ -31,10 +28,5 @@ matrix:
...
@@ -31,10 +28,5 @@ matrix:
exclude
:
exclude
:
-
python
:
"
3.2"
-
python
:
"
3.2"
env
:
DJANGO="django==1.4.5 --use-mirrors"
env
:
DJANGO="django==1.4.5 --use-mirrors"
-
python
:
"
3.2"
env
:
DJANGO="django==1.3.7 --use-mirrors"
-
python
:
"
3.3"
-
python
:
"
3.3"
env
:
DJANGO="django==1.4.5 --use-mirrors"
env
:
DJANGO="django==1.4.5 --use-mirrors"
-
python
:
"
3.3"
env
:
DJANGO="django==1.3.7 --use-mirrors"
rest_framework/authentication.py
View file @
e441f851
...
@@ -6,8 +6,8 @@ import base64
...
@@ -6,8 +6,8 @@ import base64
from
django.contrib.auth
import
authenticate
from
django.contrib.auth
import
authenticate
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.exceptions
import
ImproperlyConfigured
from
django.middleware.csrf
import
CsrfViewMiddleware
from
rest_framework
import
exceptions
,
HTTP_HEADER_ENCODING
from
rest_framework
import
exceptions
,
HTTP_HEADER_ENCODING
from
rest_framework.compat
import
CsrfViewMiddleware
from
rest_framework.compat
import
oauth
,
oauth_provider
,
oauth_provider_store
from
rest_framework.compat
import
oauth
,
oauth_provider
,
oauth_provider_store
from
rest_framework.compat
import
oauth2_provider
,
provider_now
from
rest_framework.compat
import
oauth2_provider
,
provider_now
from
rest_framework.authtoken.models
import
Token
from
rest_framework.authtoken.models
import
Token
...
...
rest_framework/compat.py
View file @
e441f851
This diff is collapsed.
Click to expand it.
rest_framework/fields.py
View file @
e441f851
...
@@ -18,12 +18,14 @@ from django.conf import settings
...
@@ -18,12 +18,14 @@ from django.conf import settings
from
django.db.models.fields
import
BLANK_CHOICE_DASH
from
django.db.models.fields
import
BLANK_CHOICE_DASH
from
django.http
import
QueryDict
from
django.http
import
QueryDict
from
django.forms
import
widgets
from
django.forms
import
widgets
from
django.utils
import
timezone
from
django.utils.encoding
import
is_protected_type
from
django.utils.encoding
import
is_protected_type
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.datastructures
import
SortedDict
from
django.utils.datastructures
import
SortedDict
from
django.utils.dateparse
import
parse_date
,
parse_datetime
,
parse_time
from
rest_framework
import
ISO_8601
from
rest_framework
import
ISO_8601
from
rest_framework.compat
import
(
from
rest_framework.compat
import
(
timezone
,
parse_date
,
parse_datetime
,
parse_time
,
BytesIO
,
six
,
smart_text
,
BytesIO
,
six
,
smart_text
,
force_text
,
is_non_str_iterable
force_text
,
is_non_str_iterable
)
)
from
rest_framework.settings
import
api_settings
from
rest_framework.settings
import
api_settings
...
...
rest_framework/routers.py
View file @
e441f851
...
@@ -17,9 +17,9 @@ from __future__ import unicode_literals
...
@@ -17,9 +17,9 @@ from __future__ import unicode_literals
import
itertools
import
itertools
from
collections
import
namedtuple
from
collections
import
namedtuple
from
django.conf.urls
import
patterns
,
url
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.exceptions
import
ImproperlyConfigured
from
rest_framework
import
views
from
rest_framework
import
views
from
rest_framework.compat
import
patterns
,
url
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
from
rest_framework.reverse
import
reverse
from
rest_framework.reverse
import
reverse
from
rest_framework.urlpatterns
import
format_suffix_patterns
from
rest_framework.urlpatterns
import
format_suffix_patterns
...
...
rest_framework/runtests/settings.py
View file @
e441f851
...
@@ -93,10 +93,7 @@ INSTALLED_APPS = (
...
@@ -93,10 +93,7 @@ INSTALLED_APPS = (
'django.contrib.sessions'
,
'django.contrib.sessions'
,
'django.contrib.sites'
,
'django.contrib.sites'
,
'django.contrib.messages'
,
'django.contrib.messages'
,
# Uncomment the next line to enable the admin:
'django.contrib.staticfiles'
,
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'rest_framework'
,
'rest_framework'
,
'rest_framework.authtoken'
,
'rest_framework.authtoken'
,
'rest_framework.tests'
,
'rest_framework.tests'
,
...
...
rest_framework/runtests/urls.py
View file @
e441f851
"""
"""
Blank URLConf just to keep runtests.py happy.
Blank URLConf just to keep runtests.py happy.
"""
"""
from
rest_framework.compat
import
patterns
from
django.conf.urls
import
patterns
urlpatterns
=
patterns
(
''
,
urlpatterns
=
patterns
(
''
,
)
)
rest_framework/serializers.py
View file @
e441f851
...
@@ -18,7 +18,7 @@ from decimal import Decimal
...
@@ -18,7 +18,7 @@ from decimal import Decimal
from
django.db
import
models
from
django.db
import
models
from
django.forms
import
widgets
from
django.forms
import
widgets
from
django.utils.datastructures
import
SortedDict
from
django.utils.datastructures
import
SortedDict
from
rest_framework.compat
import
get_concrete_model
,
six
from
rest_framework.compat
import
six
# Note: We do the following so that users of the framework can use this style:
# Note: We do the following so that users of the framework can use this style:
#
#
...
@@ -575,7 +575,7 @@ class ModelSerializer(Serializer):
...
@@ -575,7 +575,7 @@ class ModelSerializer(Serializer):
cls
=
self
.
opts
.
model
cls
=
self
.
opts
.
model
assert
cls
is
not
None
,
\
assert
cls
is
not
None
,
\
"Serializer class '
%
s' is missing 'model' Meta option"
%
self
.
__class__
.
__name__
"Serializer class '
%
s' is missing 'model' Meta option"
%
self
.
__class__
.
__name__
opts
=
get_concrete_model
(
cls
)
.
_meta
opts
=
cls
.
_meta
.
concrete_model
.
_meta
ret
=
SortedDict
()
ret
=
SortedDict
()
nested
=
bool
(
self
.
opts
.
depth
)
nested
=
bool
(
self
.
opts
.
depth
)
...
@@ -784,7 +784,7 @@ class ModelSerializer(Serializer):
...
@@ -784,7 +784,7 @@ class ModelSerializer(Serializer):
Return a list of field names to exclude from model validation.
Return a list of field names to exclude from model validation.
"""
"""
cls
=
self
.
opts
.
model
cls
=
self
.
opts
.
model
opts
=
get_concrete_model
(
cls
)
.
_meta
opts
=
cls
.
_meta
.
concrete_model
.
_meta
exclusions
=
[
field
.
name
for
field
in
opts
.
fields
+
opts
.
many_to_many
]
exclusions
=
[
field
.
name
for
field
in
opts
.
fields
+
opts
.
many_to_many
]
for
field_name
,
field
in
self
.
fields
.
items
():
for
field_name
,
field
in
self
.
fields
.
items
():
...
...
rest_framework/templates/rest_framework/base.html
View file @
e441f851
{% load url from future %}
{% load url from future %}
{% load staticfiles %}
{% load rest_framework %}
{% load rest_framework %}
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
...
...
rest_framework/templates/rest_framework/login_base.html
View file @
e441f851
{% load url from future %}
{% load url from future %}
{% load staticfiles %}
{% load rest_framework %}
{% load rest_framework %}
<html>
<html>
...
...
rest_framework/templatetags/rest_framework.py
View file @
e441f851
...
@@ -2,97 +2,14 @@ from __future__ import unicode_literals, absolute_import
...
@@ -2,97 +2,14 @@ from __future__ import unicode_literals, absolute_import
from
django
import
template
from
django
import
template
from
django.core.urlresolvers
import
reverse
,
NoReverseMatch
from
django.core.urlresolvers
import
reverse
,
NoReverseMatch
from
django.http
import
QueryDict
from
django.http
import
QueryDict
from
django.utils.html
import
escape
from
django.utils.html
import
escape
,
smart_urlquote
from
django.utils.safestring
import
SafeData
,
mark_safe
from
django.utils.safestring
import
SafeData
,
mark_safe
from
rest_framework.compat
import
urlparse
,
force_text
,
six
,
smart_urlquote
from
rest_framework.compat
import
urlparse
,
force_text
,
six
import
re
,
string
import
re
,
string
register
=
template
.
Library
()
register
=
template
.
Library
()
# Note we don't use 'load staticfiles', because we need a 1.3 compatible
# version, so instead we include the `static` template tag ourselves.
# When 1.3 becomes unsupported by REST framework, we can instead start to
# use the {% load staticfiles %} tag, remove the following code,
# and add a dependency that `django.contrib.staticfiles` must be installed.
# Note: We can't put this into the `compat` module because the compat import
# from rest_framework.compat import ...
# conflicts with this rest_framework template tag module.
try
:
# Django 1.5+
from
django.contrib.staticfiles.templatetags.staticfiles
import
StaticFilesNode
@register.tag
(
'static'
)
def
do_static
(
parser
,
token
):
return
StaticFilesNode
.
handle_token
(
parser
,
token
)
except
ImportError
:
try
:
# Django 1.4
from
django.contrib.staticfiles.storage
import
staticfiles_storage
@register.simple_tag
def
static
(
path
):
"""
A template tag that returns the URL to a file
using staticfiles' storage backend
"""
return
staticfiles_storage
.
url
(
path
)
except
ImportError
:
# Django 1.3
from
urlparse
import
urljoin
from
django
import
template
from
django.templatetags.static
import
PrefixNode
class
StaticNode
(
template
.
Node
):
def
__init__
(
self
,
varname
=
None
,
path
=
None
):
if
path
is
None
:
raise
template
.
TemplateSyntaxError
(
"Static template nodes must be given a path to return."
)
self
.
path
=
path
self
.
varname
=
varname
def
url
(
self
,
context
):
path
=
self
.
path
.
resolve
(
context
)
return
self
.
handle_simple
(
path
)
def
render
(
self
,
context
):
url
=
self
.
url
(
context
)
if
self
.
varname
is
None
:
return
url
context
[
self
.
varname
]
=
url
return
''
@classmethod
def
handle_simple
(
cls
,
path
):
return
urljoin
(
PrefixNode
.
handle_simple
(
"STATIC_URL"
),
path
)
@classmethod
def
handle_token
(
cls
,
parser
,
token
):
"""
Class method to parse prefix node and return a Node.
"""
bits
=
token
.
split_contents
()
if
len
(
bits
)
<
2
:
raise
template
.
TemplateSyntaxError
(
"'
%
s' takes at least one argument (path to file)"
%
bits
[
0
])
path
=
parser
.
compile_filter
(
bits
[
1
])
if
len
(
bits
)
>=
2
and
bits
[
-
2
]
==
'as'
:
varname
=
bits
[
3
]
else
:
varname
=
None
return
cls
(
varname
,
path
)
@register.tag
(
'static'
)
def
do_static_13
(
parser
,
token
):
return
StaticNode
.
handle_token
(
parser
,
token
)
def
replace_query_param
(
url
,
key
,
val
):
def
replace_query_param
(
url
,
key
,
val
):
"""
"""
Given a URL and a key/val pair, set or replace an item in the query
Given a URL and a key/val pair, set or replace an item in the query
...
...
rest_framework/tests/test_authentication.py
View file @
e441f851
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.conf.urls
import
patterns
,
url
,
include
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.test
import
TestCase
from
django.test
import
TestCase
...
@@ -18,7 +19,6 @@ from rest_framework.authentication import (
...
@@ -18,7 +19,6 @@ from rest_framework.authentication import (
OAuth2Authentication
OAuth2Authentication
)
)
from
rest_framework.authtoken.models
import
Token
from
rest_framework.authtoken.models
import
Token
from
rest_framework.compat
import
patterns
,
url
,
include
from
rest_framework.compat
import
oauth2_provider
,
oauth2_provider_models
,
oauth2_provider_scope
from
rest_framework.compat
import
oauth2_provider
,
oauth2_provider_models
,
oauth2_provider_scope
from
rest_framework.compat
import
oauth
,
oauth_provider
from
rest_framework.compat
import
oauth
,
oauth_provider
from
rest_framework.test
import
APIRequestFactory
,
APIClient
from
rest_framework.test
import
APIRequestFactory
,
APIClient
...
...
rest_framework/tests/test_breadcrumbs.py
View file @
e441f851
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.conf.urls
import
patterns
,
url
from
django.test
import
TestCase
from
django.test
import
TestCase
from
rest_framework.compat
import
patterns
,
url
from
rest_framework.utils.breadcrumbs
import
get_breadcrumbs
from
rest_framework.utils.breadcrumbs
import
get_breadcrumbs
from
rest_framework.views
import
APIView
from
rest_framework.views
import
APIView
...
...
rest_framework/tests/test_filters.py
View file @
e441f851
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
datetime
import
datetime
from
decimal
import
Decimal
from
decimal
import
Decimal
from
django.conf.urls
import
patterns
,
url
from
django.db
import
models
from
django.db
import
models
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.utils
import
unittest
from
django.utils
import
unittest
from
rest_framework
import
generics
,
serializers
,
status
,
filters
from
rest_framework
import
generics
,
serializers
,
status
,
filters
from
rest_framework.compat
import
django_filters
,
patterns
,
url
from
rest_framework.compat
import
django_filters
from
rest_framework.test
import
APIRequestFactory
from
rest_framework.test
import
APIRequestFactory
from
rest_framework.tests.models
import
BasicModel
from
rest_framework.tests.models
import
BasicModel
...
...
rest_framework/tests/test_htmlrenderer.py
View file @
e441f851
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.core.exceptions
import
PermissionDenied
from
django.core.exceptions
import
PermissionDenied
from
django.conf.urls
import
patterns
,
url
from
django.http
import
Http404
from
django.http
import
Http404
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.template
import
TemplateDoesNotExist
,
Template
from
django.template
import
TemplateDoesNotExist
,
Template
import
django.template.loader
import
django.template.loader
from
rest_framework
import
status
from
rest_framework
import
status
from
rest_framework.compat
import
patterns
,
url
from
rest_framework.decorators
import
api_view
,
renderer_classes
from
rest_framework.decorators
import
api_view
,
renderer_classes
from
rest_framework.renderers
import
TemplateHTMLRenderer
from
rest_framework.renderers
import
TemplateHTMLRenderer
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
...
...
rest_framework/tests/test_hyperlinkedserializers.py
View file @
e441f851
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
json
import
json
from
django.conf.urls
import
patterns
,
url
from
django.test
import
TestCase
from
django.test
import
TestCase
from
rest_framework
import
generics
,
status
,
serializers
from
rest_framework
import
generics
,
status
,
serializers
from
rest_framework.compat
import
patterns
,
url
from
rest_framework.test
import
APIRequestFactory
from
rest_framework.test
import
APIRequestFactory
from
rest_framework.tests.models
import
(
from
rest_framework.tests.models
import
(
Anchor
,
BasicModel
,
ManyToManyModel
,
BlogPost
,
BlogPostComment
,
Anchor
,
BasicModel
,
ManyToManyModel
,
BlogPost
,
BlogPostComment
,
...
@@ -24,7 +24,7 @@ class BlogPostCommentSerializer(serializers.ModelSerializer):
...
@@ -24,7 +24,7 @@ class BlogPostCommentSerializer(serializers.ModelSerializer):
class
PhotoSerializer
(
serializers
.
Serializer
):
class
PhotoSerializer
(
serializers
.
Serializer
):
description
=
serializers
.
CharField
()
description
=
serializers
.
CharField
()
album_url
=
serializers
.
HyperlinkedRelatedField
(
source
=
'album'
,
view_name
=
'album-detail'
,
queryset
=
Album
.
objects
.
all
(),
lookup_field
=
'title'
,
slug_url_kwarg
=
'title'
)
album_url
=
serializers
.
HyperlinkedRelatedField
(
source
=
'album'
,
view_name
=
'album-detail'
,
queryset
=
Album
.
objects
.
all
(),
lookup_field
=
'title'
)
def
restore_object
(
self
,
attrs
,
instance
=
None
):
def
restore_object
(
self
,
attrs
,
instance
=
None
):
return
Photo
(
**
attrs
)
return
Photo
(
**
attrs
)
...
...
rest_framework/tests/test_relations_hyperlink.py
View file @
e441f851
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.conf.urls
import
patterns
,
url
from
django.test
import
TestCase
from
django.test
import
TestCase
from
rest_framework
import
serializers
from
rest_framework
import
serializers
from
rest_framework.compat
import
patterns
,
url
from
rest_framework.test
import
APIRequestFactory
from
rest_framework.test
import
APIRequestFactory
from
rest_framework.tests.models
import
(
from
rest_framework.tests.models
import
(
BlogPost
,
BlogPost
,
...
...
rest_framework/tests/test_renderers.py
View file @
e441f851
...
@@ -2,12 +2,13 @@
...
@@ -2,12 +2,13 @@
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
decimal
import
Decimal
from
decimal
import
Decimal
from
django.conf.urls
import
patterns
,
url
,
include
from
django.core.cache
import
cache
from
django.core.cache
import
cache
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.utils
import
unittest
from
django.utils
import
unittest
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
rest_framework
import
status
,
permissions
from
rest_framework
import
status
,
permissions
from
rest_framework.compat
import
yaml
,
etree
,
patterns
,
url
,
include
,
six
,
StringIO
from
rest_framework.compat
import
yaml
,
etree
,
six
,
StringIO
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
from
rest_framework.views
import
APIView
from
rest_framework.views
import
APIView
from
rest_framework.renderers
import
BaseRenderer
,
JSONRenderer
,
YAMLRenderer
,
\
from
rest_framework.renderers
import
BaseRenderer
,
JSONRenderer
,
YAMLRenderer
,
\
...
...
rest_framework/tests/test_request.py
View file @
e441f851
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
Tests for content parsing, and form-overloaded content parsing.
Tests for content parsing, and form-overloaded content parsing.
"""
"""
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.conf.urls
import
patterns
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.contrib.auth
import
authenticate
,
login
,
logout
from
django.contrib.auth
import
authenticate
,
login
,
logout
from
django.contrib.sessions.middleware
import
SessionMiddleware
from
django.contrib.sessions.middleware
import
SessionMiddleware
from
django.test
import
TestCase
from
django.test
import
TestCase
from
rest_framework
import
status
from
rest_framework
import
status
from
rest_framework.authentication
import
SessionAuthentication
from
rest_framework.authentication
import
SessionAuthentication
from
rest_framework.compat
import
patterns
from
rest_framework.parsers
import
(
from
rest_framework.parsers
import
(
BaseParser
,
BaseParser
,
FormParser
,
FormParser
,
...
...
rest_framework/tests/test_response.py
View file @
e441f851
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.conf.urls
import
patterns
,
url
,
include
from
django.test
import
TestCase
from
django.test
import
TestCase
from
rest_framework.tests.models
import
BasicModel
,
BasicModelSerializer
from
rest_framework.tests.models
import
BasicModel
,
BasicModelSerializer
from
rest_framework.compat
import
patterns
,
url
,
include
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
from
rest_framework.views
import
APIView
from
rest_framework.views
import
APIView
from
rest_framework
import
generics
from
rest_framework
import
generics
...
...
rest_framework/tests/test_reverse.py
View file @
e441f851
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.conf.urls
import
patterns
,
url
from
django.test
import
TestCase
from
django.test
import
TestCase
from
rest_framework.compat
import
patterns
,
url
from
rest_framework.reverse
import
reverse
from
rest_framework.reverse
import
reverse
from
rest_framework.test
import
APIRequestFactory
from
rest_framework.test
import
APIRequestFactory
...
...
rest_framework/tests/test_routers.py
View file @
e441f851
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.conf.urls
import
patterns
,
url
,
include
from
django.db
import
models
from
django.db
import
models
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.exceptions
import
ImproperlyConfigured
from
rest_framework
import
serializers
,
viewsets
,
permissions
from
rest_framework
import
serializers
,
viewsets
,
permissions
from
rest_framework.compat
import
include
,
patterns
,
url
from
rest_framework.decorators
import
detail_route
,
list_route
from
rest_framework.decorators
import
detail_route
,
list_route
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
from
rest_framework.routers
import
SimpleRouter
,
DefaultRouter
from
rest_framework.routers
import
SimpleRouter
,
DefaultRouter
...
...
rest_framework/tests/test_testing.py
View file @
e441f851
# -- coding: utf-8 --
# -- coding: utf-8 --
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.conf.urls
import
patterns
,
url
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.test
import
TestCase
from
django.test
import
TestCase
from
rest_framework.compat
import
patterns
,
url
from
rest_framework.decorators
import
api_view
from
rest_framework.decorators
import
api_view
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
from
rest_framework.test
import
APIClient
,
APIRequestFactory
,
force_authenticate
from
rest_framework.test
import
APIClient
,
APIRequestFactory
,
force_authenticate
...
...
rest_framework/tests/test_urlpatterns.py
View file @
e441f851
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
collections
import
namedtuple
from
collections
import
namedtuple
from
django.conf.urls
import
patterns
,
url
,
include
from
django.core
import
urlresolvers
from
django.core
import
urlresolvers
from
django.test
import
TestCase
from
django.test
import
TestCase
from
rest_framework.test
import
APIRequestFactory
from
rest_framework.test
import
APIRequestFactory
from
rest_framework.compat
import
patterns
,
url
,
include
from
rest_framework.urlpatterns
import
format_suffix_patterns
from
rest_framework.urlpatterns
import
format_suffix_patterns
...
...
rest_framework/urlpatterns.py
View file @
e441f851
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.conf.urls
import
url
,
include
from
django.core.urlresolvers
import
RegexURLResolver
from
django.core.urlresolvers
import
RegexURLResolver
from
rest_framework.compat
import
url
,
include
from
rest_framework.settings
import
api_settings
from
rest_framework.settings
import
api_settings
...
...
rest_framework/urls.py
View file @
e441f851
...
@@ -13,7 +13,7 @@ your authentication settings include `SessionAuthentication`.
...
@@ -13,7 +13,7 @@ your authentication settings include `SessionAuthentication`.
)
)
"""
"""
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
rest_framework.compat
import
patterns
,
url
from
django.conf.urls
import
patterns
,
url
template_name
=
{
'template_name'
:
'rest_framework/login.html'
}
template_name
=
{
'template_name'
:
'rest_framework/login.html'
}
...
...
rest_framework/utils/encoders.py
View file @
e441f851
...
@@ -2,9 +2,10 @@
...
@@ -2,9 +2,10 @@
Helper classes for parsers.
Helper classes for parsers.
"""
"""
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.utils
import
timezone
from
django.utils.datastructures
import
SortedDict
from
django.utils.datastructures
import
SortedDict
from
django.utils.functional
import
Promise
from
django.utils.functional
import
Promise
from
rest_framework.compat
import
timezone
,
force_text
from
rest_framework.compat
import
force_text
from
rest_framework.serializers
import
DictWithMetadata
,
SortedDictWithMetadata
from
rest_framework.serializers
import
DictWithMetadata
,
SortedDictWithMetadata
import
datetime
import
datetime
import
decimal
import
decimal
...
...
tox.ini
View file @
e441f851
[tox]
[tox]
downloadcache
=
{toxworkdir}/cache/
downloadcache
=
{toxworkdir}/cache/
envlist
=
py3.3-django1.6,py3.2-django1.6,py2.7-django1.6,py2.6-django1.6,py3.3-django1.5,py3.2-django1.5,py2.7-django1.5,py2.6-django1.5,py2.7-django1.4,py2.6-django1.4
,py2.7-django1.3,py2.6-django1.3
envlist
=
py3.3-django1.6,py3.2-django1.6,py2.7-django1.6,py2.6-django1.6,py3.3-django1.5,py3.2-django1.5,py2.7-django1.5,py2.6-django1.5,py2.7-django1.4,py2.6-django1.4
[testenv]
[testenv]
commands
=
{envpython} rest_framework/runtests/runtests.py
commands
=
{envpython} rest_framework/runtests/runtests.py
...
@@ -88,23 +88,3 @@ deps = django==1.4.3
...
@@ -88,23 +88,3 @@ deps = django==1.4.3
oauth2
=
=1.5.211
oauth2
=
=1.5.211
django-oauth2-provider
=
=0.2.3
django-oauth2-provider
=
=0.2.3
django-guardian
=
=1.1.1
django-guardian
=
=1.1.1
[testenv:py2.7-django1.3]
basepython
=
python2.7
deps
=
django==1.3.5
django-filter
=
=0.5.4
defusedxml
=
=0.3
django-oauth-plus
=
=2.0
oauth2
=
=1.5.211
django-oauth2-provider
=
=0.2.3
django-guardian
=
=1.1.1
[testenv:py2.6-django1.3]
basepython
=
python2.6
deps
=
django==1.3.5
django-filter
=
=0.5.4
defusedxml
=
=0.3
django-oauth-plus
=
=2.0
oauth2
=
=1.5.211
django-oauth2-provider
=
=0.2.3
django-guardian
=
=1.1.1
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