1👍
✅
There’s really no such thing as blank
in the database, or null
in the admin. null
controls whether the database can contain NULL
values (not even empty values, just NULL
). blank
controls whether the admin and modelforms accept empty values.
It seems to me that what you want is simply null=True, blank=False
.
👤knbk
0👍
We did this just by change the Model
field to not allow null/blank and add default value, and also write a script to add default value to the already existed data whose field is null/blank.
- [Answer]-Django – Legacy MySQL data migration errors
- [Answer]-Inserting a foreign field in django forms
- [Answer]-Socket communication with Django
Source:stackexchange.com