aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/fields.py
diff options
context:
space:
mode:
authorTom Christie2014-08-19 16:15:48 +0100
committerTom Christie2014-08-19 16:15:48 +0100
commit390061bed0991892dfa6c9b953fffc1bd15564a9 (patch)
tree19b77e0e7b2c3559e7a427196364e7d1060b08b5 /rest_framework/fields.py
parente385a7b8eb6e538698f28128e43fe8bfaefd4e97 (diff)
parent2d2737f367c241c29c9c3913f2dba986c7c9a4a5 (diff)
downloaddjango-rest-framework-390061bed0991892dfa6c9b953fffc1bd15564a9.tar.bz2
Merge pull request #1780 from tomchristie/pytest-tweaks
Added `runtests.py` and `flake8` code linting.
Diffstat (limited to 'rest_framework/fields.py')
-rw-r--r--rest_framework/fields.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index 43a74ae6..85fcbd96 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -63,8 +63,10 @@ def get_component(obj, attr_name):
def readable_datetime_formats(formats):
- format = ', '.join(formats).replace(ISO_8601,
- 'YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]')
+ format = ', '.join(formats).replace(
+ ISO_8601,
+ 'YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]'
+ )
return humanize_strptime(format)
@@ -425,7 +427,7 @@ class ModelField(WritableField):
}
-##### Typed Fields #####
+# Typed Fields
class BooleanField(WritableField):
type_name = 'BooleanField'
@@ -484,7 +486,7 @@ class URLField(CharField):
type_label = 'url'
def __init__(self, **kwargs):
- if not 'validators' in kwargs:
+ if 'validators' not in kwargs:
kwargs['validators'] = [validators.URLValidator()]
super(URLField, self).__init__(**kwargs)