Closed berycz closed 11 months ago
or maybe to add
class Field:
...
def is_empty(self):
if self.parse_empty_string_as_none and self.parsed_data is None:
return True
elif not self.parse_empty_string_as_none and self.parsed_data == "":
return True
return False
which could be overriden for some specific fields?
This also seems to be a regression - it does not happen in 6.0.0
, and appears first in 6.1.0
.
I have a
CharField
with choices,blank=True
,null=False
the select gets the first empty choice but if I leave it empty and submit, I get "not in available choices"I'm not sure whether this should be in
Field._validate
where you check forself.parsed_data is not None
or if it should be inchoice_is_valid
?