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
a101251a
Commit
a101251a
authored
Mar 17, 2016
by
Stephan Groß
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix blank lines around docstrings
parent
1339fba1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
4 additions
and
17 deletions
+4
-17
rest_framework/decorators.py
+0
-1
rest_framework/generics.py
+0
-3
rest_framework/parsers.py
+0
-5
rest_framework/permissions.py
+1
-1
rest_framework/relations.py
+0
-1
rest_framework/renderers.py
+0
-3
rest_framework/request.py
+2
-0
rest_framework/routers.py
+0
-1
rest_framework/throttling.py
+1
-1
rest_framework/utils/breadcrumbs.py
+0
-1
No files found.
rest_framework/decorators.py
View file @
a101251a
...
@@ -16,7 +16,6 @@ from rest_framework.views import APIView
...
@@ -16,7 +16,6 @@ from rest_framework.views import APIView
def
api_view
(
http_method_names
=
None
):
def
api_view
(
http_method_names
=
None
):
"""
"""
Decorator that converts a function-based view into an APIView subclass.
Decorator that converts a function-based view into an APIView subclass.
Takes a list of allowed methods for the view as an argument.
Takes a list of allowed methods for the view as an argument.
...
...
rest_framework/generics.py
View file @
a101251a
...
@@ -184,7 +184,6 @@ class GenericAPIView(views.APIView):
...
@@ -184,7 +184,6 @@ class GenericAPIView(views.APIView):
class
CreateAPIView
(
mixins
.
CreateModelMixin
,
class
CreateAPIView
(
mixins
.
CreateModelMixin
,
GenericAPIView
):
GenericAPIView
):
"""
"""
Concrete view for creating a model instance.
Concrete view for creating a model instance.
"""
"""
...
@@ -212,7 +211,6 @@ class RetrieveAPIView(mixins.RetrieveModelMixin,
...
@@ -212,7 +211,6 @@ class RetrieveAPIView(mixins.RetrieveModelMixin,
class
DestroyAPIView
(
mixins
.
DestroyModelMixin
,
class
DestroyAPIView
(
mixins
.
DestroyModelMixin
,
GenericAPIView
):
GenericAPIView
):
"""
"""
Concrete view for deleting a model instance.
Concrete view for deleting a model instance.
"""
"""
...
@@ -222,7 +220,6 @@ class DestroyAPIView(mixins.DestroyModelMixin,
...
@@ -222,7 +220,6 @@ class DestroyAPIView(mixins.DestroyModelMixin,
class
UpdateAPIView
(
mixins
.
UpdateModelMixin
,
class
UpdateAPIView
(
mixins
.
UpdateModelMixin
,
GenericAPIView
):
GenericAPIView
):
"""
"""
Concrete view for updating a model instance.
Concrete view for updating a model instance.
"""
"""
...
...
rest_framework/parsers.py
View file @
a101251a
...
@@ -35,7 +35,6 @@ class BaseParser(object):
...
@@ -35,7 +35,6 @@ class BaseParser(object):
All parsers should extend `BaseParser`, specifying a `media_type`
All parsers should extend `BaseParser`, specifying a `media_type`
attribute, and overriding the `.parse()` method.
attribute, and overriding the `.parse()` method.
"""
"""
media_type
=
None
media_type
=
None
def
parse
(
self
,
stream
,
media_type
=
None
,
parser_context
=
None
):
def
parse
(
self
,
stream
,
media_type
=
None
,
parser_context
=
None
):
...
@@ -51,7 +50,6 @@ class JSONParser(BaseParser):
...
@@ -51,7 +50,6 @@ class JSONParser(BaseParser):
"""
"""
Parses JSON-serialized data.
Parses JSON-serialized data.
"""
"""
media_type
=
'application/json'
media_type
=
'application/json'
renderer_class
=
renderers
.
JSONRenderer
renderer_class
=
renderers
.
JSONRenderer
...
@@ -73,7 +71,6 @@ class FormParser(BaseParser):
...
@@ -73,7 +71,6 @@ class FormParser(BaseParser):
"""
"""
Parser for form data.
Parser for form data.
"""
"""
media_type
=
'application/x-www-form-urlencoded'
media_type
=
'application/x-www-form-urlencoded'
def
parse
(
self
,
stream
,
media_type
=
None
,
parser_context
=
None
):
def
parse
(
self
,
stream
,
media_type
=
None
,
parser_context
=
None
):
...
@@ -91,7 +88,6 @@ class MultiPartParser(BaseParser):
...
@@ -91,7 +88,6 @@ class MultiPartParser(BaseParser):
"""
"""
Parser for multipart form data, which may include file data.
Parser for multipart form data, which may include file data.
"""
"""
media_type
=
'multipart/form-data'
media_type
=
'multipart/form-data'
def
parse
(
self
,
stream
,
media_type
=
None
,
parser_context
=
None
):
def
parse
(
self
,
stream
,
media_type
=
None
,
parser_context
=
None
):
...
@@ -131,7 +127,6 @@ class FileUploadParser(BaseParser):
...
@@ -131,7 +127,6 @@ class FileUploadParser(BaseParser):
`.data` will be None (we expect request body to be a file content).
`.data` will be None (we expect request body to be a file content).
`.files` will be a `QueryDict` containing one 'file' element.
`.files` will be a `QueryDict` containing one 'file' element.
"""
"""
parser_context
=
parser_context
or
{}
parser_context
=
parser_context
or
{}
request
=
parser_context
[
'request'
]
request
=
parser_context
[
'request'
]
encoding
=
parser_context
.
get
(
'encoding'
,
settings
.
DEFAULT_CHARSET
)
encoding
=
parser_context
.
get
(
'encoding'
,
settings
.
DEFAULT_CHARSET
)
...
...
rest_framework/permissions.py
View file @
a101251a
...
@@ -33,6 +33,7 @@ class AllowAny(BasePermission):
...
@@ -33,6 +33,7 @@ class AllowAny(BasePermission):
permission_classes list, but it's useful because it makes the intention
permission_classes list, but it's useful because it makes the intention
more explicit.
more explicit.
"""
"""
def
has_permission
(
self
,
request
,
view
):
def
has_permission
(
self
,
request
,
view
):
return
True
return
True
...
@@ -150,7 +151,6 @@ class DjangoObjectPermissions(DjangoModelPermissions):
...
@@ -150,7 +151,6 @@ class DjangoObjectPermissions(DjangoModelPermissions):
This permission can only be applied against view classes that
This permission can only be applied against view classes that
provide a `.queryset` attribute.
provide a `.queryset` attribute.
"""
"""
perms_map
=
{
perms_map
=
{
'GET'
:
[],
'GET'
:
[],
'OPTIONS'
:
[],
'OPTIONS'
:
[],
...
...
rest_framework/relations.py
View file @
a101251a
...
@@ -397,7 +397,6 @@ class SlugRelatedField(RelatedField):
...
@@ -397,7 +397,6 @@ class SlugRelatedField(RelatedField):
A read-write field that represents the target of the relationship
A read-write field that represents the target of the relationship
by a unique 'slug' attribute.
by a unique 'slug' attribute.
"""
"""
default_error_messages
=
{
default_error_messages
=
{
'does_not_exist'
:
_
(
'Object with {slug_name}={value} does not exist.'
),
'does_not_exist'
:
_
(
'Object with {slug_name}={value} does not exist.'
),
'invalid'
:
_
(
'Invalid value.'
),
'invalid'
:
_
(
'Invalid value.'
),
...
...
rest_framework/renderers.py
View file @
a101251a
...
@@ -40,7 +40,6 @@ class BaseRenderer(object):
...
@@ -40,7 +40,6 @@ class BaseRenderer(object):
All renderers should extend this class, setting the `media_type`
All renderers should extend this class, setting the `media_type`
and `format` attributes, and override the `.render()` method.
and `format` attributes, and override the `.render()` method.
"""
"""
media_type
=
None
media_type
=
None
format
=
None
format
=
None
charset
=
'utf-8'
charset
=
'utf-8'
...
@@ -54,7 +53,6 @@ class JSONRenderer(BaseRenderer):
...
@@ -54,7 +53,6 @@ class JSONRenderer(BaseRenderer):
"""
"""
Renderer which serializes to JSON.
Renderer which serializes to JSON.
"""
"""
media_type
=
'application/json'
media_type
=
'application/json'
format
=
'json'
format
=
'json'
encoder_class
=
encoders
.
JSONEncoder
encoder_class
=
encoders
.
JSONEncoder
...
@@ -136,7 +134,6 @@ class TemplateHTMLRenderer(BaseRenderer):
...
@@ -136,7 +134,6 @@ class TemplateHTMLRenderer(BaseRenderer):
For pre-rendered HTML, see StaticHTMLRenderer.
For pre-rendered HTML, see StaticHTMLRenderer.
"""
"""
media_type
=
'text/html'
media_type
=
'text/html'
format
=
'html'
format
=
'html'
template_name
=
None
template_name
=
None
...
...
rest_framework/request.py
View file @
a101251a
...
@@ -41,6 +41,7 @@ class override_method(object):
...
@@ -41,6 +41,7 @@ class override_method(object):
with override_method(view, request, 'POST') as request:
with override_method(view, request, 'POST') as request:
... # Do stuff with `view` and `request`
... # Do stuff with `view` and `request`
"""
"""
def
__init__
(
self
,
view
,
request
,
method
):
def
__init__
(
self
,
view
,
request
,
method
):
self
.
view
=
view
self
.
view
=
view
self
.
request
=
request
self
.
request
=
request
...
@@ -129,6 +130,7 @@ class Request(object):
...
@@ -129,6 +130,7 @@ class Request(object):
- authentication_classes(list/tuple). The authentications used to try
- authentication_classes(list/tuple). The authentications used to try
authenticating the request's user.
authenticating the request's user.
"""
"""
def
__init__
(
self
,
request
,
parsers
=
None
,
authenticators
=
None
,
def
__init__
(
self
,
request
,
parsers
=
None
,
authenticators
=
None
,
negotiator
=
None
,
parser_context
=
None
):
negotiator
=
None
,
parser_context
=
None
):
self
.
_request
=
request
self
.
_request
=
request
...
...
rest_framework/routers.py
View file @
a101251a
...
@@ -144,7 +144,6 @@ class SimpleRouter(BaseRouter):
...
@@ -144,7 +144,6 @@ class SimpleRouter(BaseRouter):
Returns a list of the Route namedtuple.
Returns a list of the Route namedtuple.
"""
"""
known_actions
=
flatten
([
route
.
mapping
.
values
()
for
route
in
self
.
routes
if
isinstance
(
route
,
Route
)])
known_actions
=
flatten
([
route
.
mapping
.
values
()
for
route
in
self
.
routes
if
isinstance
(
route
,
Route
)])
# Determine any `@detail_route` or `@list_route` decorated methods on the viewset
# Determine any `@detail_route` or `@list_route` decorated methods on the viewset
...
...
rest_framework/throttling.py
View file @
a101251a
...
@@ -15,6 +15,7 @@ class BaseThrottle(object):
...
@@ -15,6 +15,7 @@ class BaseThrottle(object):
"""
"""
Rate throttling of requests.
Rate throttling of requests.
"""
"""
def
allow_request
(
self
,
request
,
view
):
def
allow_request
(
self
,
request
,
view
):
"""
"""
Return `True` if the request should be allowed, `False` otherwise.
Return `True` if the request should be allowed, `False` otherwise.
...
@@ -60,7 +61,6 @@ class SimpleRateThrottle(BaseThrottle):
...
@@ -60,7 +61,6 @@ class SimpleRateThrottle(BaseThrottle):
Previous request information used for throttling is stored in the cache.
Previous request information used for throttling is stored in the cache.
"""
"""
cache
=
default_cache
cache
=
default_cache
timer
=
time
.
time
timer
=
time
.
time
cache_format
=
'throttle_
%(scope)
s_
%(ident)
s'
cache_format
=
'throttle_
%(scope)
s_
%(ident)
s'
...
...
rest_framework/utils/breadcrumbs.py
View file @
a101251a
...
@@ -19,7 +19,6 @@ def get_breadcrumbs(url, request=None):
...
@@ -19,7 +19,6 @@ def get_breadcrumbs(url, request=None):
Add tuples of (name, url) to the breadcrumbs list,
Add tuples of (name, url) to the breadcrumbs list,
progressively chomping off parts of the url.
progressively chomping off parts of the url.
"""
"""
try
:
try
:
(
view
,
unused_args
,
unused_kwargs
)
=
resolve
(
url
)
(
view
,
unused_args
,
unused_kwargs
)
=
resolve
(
url
)
except
Exception
:
except
Exception
:
...
...
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