aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/fields.py
diff options
context:
space:
mode:
authorTom Christie2014-10-02 18:13:15 +0100
committerTom Christie2014-10-02 18:13:15 +0100
commitfec7c4b45812d22423e73ec3ab801857a55d7340 (patch)
tree86a26d374d7b627c464841700988aa5ff4712ef3 /rest_framework/fields.py
parentdf7b6fcf58417fd95e49655eb140b387899b1ceb (diff)
downloaddjango-rest-framework-fec7c4b45812d22423e73ec3ab801857a55d7340.tar.bz2
Browsable API tweaks
Diffstat (limited to 'rest_framework/fields.py')
-rw-r--r--rest_framework/fields.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index c794963e..3f22660c 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -106,7 +106,7 @@ class Field(object):
'null': _('This field may not be null.')
}
default_validators = []
- default_empty_html = None
+ default_empty_html = empty
initial = None
def __init__(self, read_only=False, write_only=False,
@@ -375,7 +375,6 @@ class NullBooleanField(Field):
default_error_messages = {
'invalid': _('`{input}` is not a valid boolean.')
}
- default_empty_html = None
initial = None
TRUE_VALUES = set(('t', 'T', 'true', 'True', 'TRUE', '1', 1, True))
FALSE_VALUES = set(('f', 'F', 'false', 'False', 'FALSE', '0', 0, 0.0, False))
@@ -411,7 +410,6 @@ class CharField(Field):
default_error_messages = {
'blank': _('This field may not be blank.')
}
- default_empty_html = ''
initial = ''
def __init__(self, **kwargs):
@@ -852,6 +850,7 @@ class MultipleChoiceField(ChoiceField):
'invalid_choice': _('`{input}` is not a valid choice.'),
'not_a_list': _('Expected a list of items but got type `{input_type}`')
}
+ default_empty_html = []
def to_internal_value(self, data):
if isinstance(data, type('')) or not hasattr(data, '__iter__'):