def clean_empty_string(obj):
if obj == '<STR_LIT>':<EOL><INDENT>return None<EOL><DEDENT>if isinstance(obj, list):<EOL><INDENT>return [<EOL>None if item == '<STR_LIT>' else item<EOL>for item in obj<EOL>]<EOL><DEDENT>if isinstance(obj, dict):<EOL><INDENT>for key in obj:<EOL><INDENT>obj[key] = clean_empty_string(obj[key])<EOL><DEDENT><DEDENT>return obj<EOL>
Replace empty form values with None, since the is_html_input() check in
Field won't work after we convert to JSON.
(FIXME: What about allow_blank=True?)