mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-08 15:43:32 +03:00
pep8
This commit is contained in:
parent
2026d5f1d9
commit
44207a347a
|
@ -1,6 +1,8 @@
|
||||||
"""
|
"""
|
||||||
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
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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]]
|
||||||
|
|
||||||
|
|
|
@ -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):
|
||||||
|
|
|
@ -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)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user