Skip to content

Commit 3645388

Browse files
committed
Merge pull request #4002 from minddust/minor_tweaks
Fix blank lines around docstrings
2 parents 1339fba + a101251 commit 3645388

10 files changed

+4
-17
lines changed

rest_framework/decorators.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717

1818
def api_view(http_method_names=None):
19-
2019
"""
2120
Decorator that converts a function-based view into an APIView subclass.
2221
Takes a list of allowed methods for the view as an argument.

rest_framework/generics.py

-3
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ def get_paginated_response(self, data):
184184

185185
class CreateAPIView(mixins.CreateModelMixin,
186186
GenericAPIView):
187-
188187
"""
189188
Concrete view for creating a model instance.
190189
"""
@@ -212,7 +211,6 @@ def get(self, request, *args, **kwargs):
212211

213212
class DestroyAPIView(mixins.DestroyModelMixin,
214213
GenericAPIView):
215-
216214
"""
217215
Concrete view for deleting a model instance.
218216
"""
@@ -222,7 +220,6 @@ def delete(self, request, *args, **kwargs):
222220

223221
class UpdateAPIView(mixins.UpdateModelMixin,
224222
GenericAPIView):
225-
226223
"""
227224
Concrete view for updating a model instance.
228225
"""

rest_framework/parsers.py

-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class BaseParser(object):
3535
All parsers should extend `BaseParser`, specifying a `media_type`
3636
attribute, and overriding the `.parse()` method.
3737
"""
38-
3938
media_type = None
4039

4140
def parse(self, stream, media_type=None, parser_context=None):
@@ -51,7 +50,6 @@ class JSONParser(BaseParser):
5150
"""
5251
Parses JSON-serialized data.
5352
"""
54-
5553
media_type = 'application/json'
5654
renderer_class = renderers.JSONRenderer
5755

@@ -73,7 +71,6 @@ class FormParser(BaseParser):
7371
"""
7472
Parser for form data.
7573
"""
76-
7774
media_type = 'application/x-www-form-urlencoded'
7875

7976
def parse(self, stream, media_type=None, parser_context=None):
@@ -91,7 +88,6 @@ class MultiPartParser(BaseParser):
9188
"""
9289
Parser for multipart form data, which may include file data.
9390
"""
94-
9591
media_type = 'multipart/form-data'
9692

9793
def parse(self, stream, media_type=None, parser_context=None):
@@ -131,7 +127,6 @@ def parse(self, stream, media_type=None, parser_context=None):
131127
`.data` will be None (we expect request body to be a file content).
132128
`.files` will be a `QueryDict` containing one 'file' element.
133129
"""
134-
135130
parser_context = parser_context or {}
136131
request = parser_context['request']
137132
encoding = parser_context.get('encoding', settings.DEFAULT_CHARSET)

rest_framework/permissions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class AllowAny(BasePermission):
3333
permission_classes list, but it's useful because it makes the intention
3434
more explicit.
3535
"""
36+
3637
def has_permission(self, request, view):
3738
return True
3839

@@ -150,7 +151,6 @@ class DjangoObjectPermissions(DjangoModelPermissions):
150151
This permission can only be applied against view classes that
151152
provide a `.queryset` attribute.
152153
"""
153-
154154
perms_map = {
155155
'GET': [],
156156
'OPTIONS': [],

rest_framework/relations.py

-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ class SlugRelatedField(RelatedField):
397397
A read-write field that represents the target of the relationship
398398
by a unique 'slug' attribute.
399399
"""
400-
401400
default_error_messages = {
402401
'does_not_exist': _('Object with {slug_name}={value} does not exist.'),
403402
'invalid': _('Invalid value.'),

rest_framework/renderers.py

-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class BaseRenderer(object):
4040
All renderers should extend this class, setting the `media_type`
4141
and `format` attributes, and override the `.render()` method.
4242
"""
43-
4443
media_type = None
4544
format = None
4645
charset = 'utf-8'
@@ -54,7 +53,6 @@ class JSONRenderer(BaseRenderer):
5453
"""
5554
Renderer which serializes to JSON.
5655
"""
57-
5856
media_type = 'application/json'
5957
format = 'json'
6058
encoder_class = encoders.JSONEncoder
@@ -136,7 +134,6 @@ class TemplateHTMLRenderer(BaseRenderer):
136134
137135
For pre-rendered HTML, see StaticHTMLRenderer.
138136
"""
139-
140137
media_type = 'text/html'
141138
format = 'html'
142139
template_name = None

rest_framework/request.py

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class override_method(object):
4141
with override_method(view, request, 'POST') as request:
4242
... # Do stuff with `view` and `request`
4343
"""
44+
4445
def __init__(self, view, request, method):
4546
self.view = view
4647
self.request = request
@@ -129,6 +130,7 @@ class Request(object):
129130
- authentication_classes(list/tuple). The authentications used to try
130131
authenticating the request's user.
131132
"""
133+
132134
def __init__(self, request, parsers=None, authenticators=None,
133135
negotiator=None, parser_context=None):
134136
self._request = request

rest_framework/routers.py

-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ def get_routes(self, viewset):
144144
145145
Returns a list of the Route namedtuple.
146146
"""
147-
148147
known_actions = flatten([route.mapping.values() for route in self.routes if isinstance(route, Route)])
149148

150149
# Determine any `@detail_route` or `@list_route` decorated methods on the viewset

rest_framework/throttling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class BaseThrottle(object):
1515
"""
1616
Rate throttling of requests.
1717
"""
18+
1819
def allow_request(self, request, view):
1920
"""
2021
Return `True` if the request should be allowed, `False` otherwise.
@@ -60,7 +61,6 @@ class SimpleRateThrottle(BaseThrottle):
6061
6162
Previous request information used for throttling is stored in the cache.
6263
"""
63-
6464
cache = default_cache
6565
timer = time.time
6666
cache_format = 'throttle_%(scope)s_%(ident)s'

rest_framework/utils/breadcrumbs.py

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def breadcrumbs_recursive(url, breadcrumbs_list, prefix, seen):
1919
Add tuples of (name, url) to the breadcrumbs list,
2020
progressively chomping off parts of the url.
2121
"""
22-
2322
try:
2423
(view, unused_args, unused_kwargs) = resolve(url)
2524
except Exception:

0 commit comments

Comments
 (0)