Commit 6794b338 by Tom Christie

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

parent 7d417fc6
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment