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
44207a34
Commit
44207a34
authored
Oct 27, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pep8
parent
2026d5f1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
9 deletions
+11
-9
rest_framework/compat.py
+3
-1
rest_framework/generics.py
+1
-1
rest_framework/permissions.py
+1
-1
rest_framework/request.py
+2
-2
rest_framework/serializers.py
+4
-4
No files found.
rest_framework/compat.py
View file @
44207a34
"""
"""
The :mod:`compat` module provides support for backwards compatibility with older versions of django/python.
The `compat` module provides support for backwards compatibility with older
versions of django/python, and compatbility wrappers around optional packages.
"""
"""
# flake8: noqa
import
django
import
django
# cStringIO only if it's available, otherwise StringIO
# cStringIO only if it's available, otherwise StringIO
...
...
rest_framework/generics.py
View file @
44207a34
...
@@ -125,7 +125,7 @@ class RetrieveAPIView(mixins.RetrieveModelMixin,
...
@@ -125,7 +125,7 @@ class RetrieveAPIView(mixins.RetrieveModelMixin,
class
DestroyAPIView
(
mixins
.
DestroyModelMixin
,
class
DestroyAPIView
(
mixins
.
DestroyModelMixin
,
SingleObjectAPIView
):
SingleObjectAPIView
):
"""
"""
Concrete view for deleting a model instance.
Concrete view for deleting a model instance.
...
...
rest_framework/permissions.py
View file @
44207a34
...
@@ -85,7 +85,7 @@ class DjangoModelPermissions(BasePermission):
...
@@ -85,7 +85,7 @@ class DjangoModelPermissions(BasePermission):
"""
"""
kwargs
=
{
kwargs
=
{
'app_label'
:
model_cls
.
_meta
.
app_label
,
'app_label'
:
model_cls
.
_meta
.
app_label
,
'model_name'
:
model_cls
.
_meta
.
module_name
'model_name'
:
model_cls
.
_meta
.
module_name
}
}
return
[
perm
%
kwargs
for
perm
in
self
.
perms_map
[
method
]]
return
[
perm
%
kwargs
for
perm
in
self
.
perms_map
[
method
]]
...
...
rest_framework/request.py
View file @
44207a34
...
@@ -21,8 +21,8 @@ def is_form_media_type(media_type):
...
@@ -21,8 +21,8 @@ def is_form_media_type(media_type):
Return True if the media type is a valid form media type.
Return True if the media type is a valid form media type.
"""
"""
base_media_type
,
params
=
parse_header
(
media_type
)
base_media_type
,
params
=
parse_header
(
media_type
)
return
base_media_type
==
'application/x-www-form-urlencoded'
or
\
return
(
base_media_type
==
'application/x-www-form-urlencoded'
or
base_media_type
==
'multipart/form-data'
base_media_type
==
'multipart/form-data'
)
class
Empty
(
object
):
class
Empty
(
object
):
...
...
rest_framework/serializers.py
View file @
44207a34
...
@@ -34,10 +34,10 @@ def _is_protected_type(obj):
...
@@ -34,10 +34,10 @@ def _is_protected_type(obj):
"""
"""
return
isinstance
(
obj
,
(
return
isinstance
(
obj
,
(
types
.
NoneType
,
types
.
NoneType
,
int
,
long
,
int
,
long
,
datetime
.
datetime
,
datetime
.
date
,
datetime
.
time
,
datetime
.
datetime
,
datetime
.
date
,
datetime
.
time
,
float
,
Decimal
,
float
,
Decimal
,
basestring
)
basestring
)
)
)
...
...
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