I have a django model, which has a int field (with null=True, blank=True). Now when I get a form submit from the user, I assign it like so:
my_model.width= form.cleaned_data['width']
However sometimes I get an error:
ValueError: invalid literal for int() with base 10: ''
I was wandering if it's the blank ('') string value that gets assigned to the field? Because my understanding was the model will treat blank string as null/blank?
Any help would be appreciated in this matter. Thanks.