Fixes for defaulting empty HTML fields to '', None, or empty.

This commit is contained in:
Tom Christie 2014-11-20 12:15:33 +00:00
parent 7d417fc678
commit 6794b3380a

View File

@ -181,6 +181,9 @@ class Field(object):
self.style = {} if style is None else style
self.allow_null = allow_null
if allow_null and self.default_empty_html is empty:
self.default_empty_html = None
if validators is not None:
self.validators = validators[:]
@ -495,6 +498,7 @@ class CharField(Field):
}
initial = ''
coerce_blank_to_null = False
default_empty_html = ''
def __init__(self, **kwargs):
self.allow_blank = kwargs.pop('allow_blank', False)