I have a model with a nullable field (PositiveSmallIntegerField) with defined choices. When I make a ModelForm for the model and do not select a value for this field, the field always comes back in the changed data. The reason is that the empty choice value, the data_value, is an empty string, while the initial_value is None.
I can override the base field and make a TypedChoiceField, and provide a function to coerce which returns None if the value is an empty string.
Is this the only route, or is there a better way to accomplish this?