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
001884a1
Commit
001884a1
authored
Dec 04, 2014
by
Tymur Maryokhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unused compat code
parent
95af92ca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
27 deletions
+0
-27
rest_framework/compat.py
+0
-27
No files found.
rest_framework/compat.py
View file @
001884a1
...
@@ -61,15 +61,6 @@ if 'guardian' in settings.INSTALLED_APPS:
...
@@ -61,15 +61,6 @@ if 'guardian' in settings.INSTALLED_APPS:
pass
pass
# UserDict moves in Python 3
try
:
from
UserDict
import
UserDict
from
UserDict
import
DictMixin
except
ImportError
:
from
collections
import
UserDict
from
collections
import
MutableMapping
as
DictMixin
def
get_model_name
(
model_cls
):
def
get_model_name
(
model_cls
):
try
:
try
:
return
model_cls
.
_meta
.
model_name
return
model_cls
.
_meta
.
model_name
...
@@ -177,11 +168,6 @@ class RequestFactory(DjangoRequestFactory):
...
@@ -177,11 +168,6 @@ class RequestFactory(DjangoRequestFactory):
'CONTENT_TYPE'
:
six
.
text_type
(
content_type
),
'CONTENT_TYPE'
:
six
.
text_type
(
content_type
),
'wsgi.input'
:
FakePayload
(
data
),
'wsgi.input'
:
FakePayload
(
data
),
})
})
elif
django
.
VERSION
<=
(
1
,
4
):
# For 1.3 we need an empty WSGI payload
r
.
update
({
'wsgi.input'
:
FakePayload
(
''
)
})
r
.
update
(
extra
)
r
.
update
(
extra
)
return
self
.
request
(
**
r
)
return
self
.
request
(
**
r
)
...
@@ -278,16 +264,3 @@ if six.PY3:
...
@@ -278,16 +264,3 @@ if six.PY3:
else
:
else
:
SHORT_SEPARATORS
=
(
b
','
,
b
':'
)
SHORT_SEPARATORS
=
(
b
','
,
b
':'
)
LONG_SEPARATORS
=
(
b
', '
,
b
': '
)
LONG_SEPARATORS
=
(
b
', '
,
b
': '
)
# Handle lazy strings across Py2/Py3
from
django.utils.functional
import
Promise
if
six
.
PY3
:
def
is_non_str_iterable
(
obj
):
if
isinstance
(
obj
,
str
)
or
(
isinstance
(
obj
,
Promise
)
and
obj
.
_delegate_text
):
return
False
return
hasattr
(
obj
,
'__iter__'
)
else
:
def
is_non_str_iterable
(
obj
):
return
hasattr
(
obj
,
'__iter__'
)
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