Clarify documentation on Field.blank and Field.null options
|Reported by:||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I find the documentation on the 'null' and 'blank' options for model fields do miss one point.
It is clearly stated that 'null' is for the database contraints and 'blank' is for the form validation (less clear though). While there are almost two paragraphs describing the correct setting for allowing empty string values (null=False, blank=True), it is not perfectly clear what setting is needed in order to deal with empty values for the remaining field types.
I missed one sentence like for (almost?) all other field types you need to set both blank and null to True in order to allow for empty values in your model.
Or am I missing something else? (I'm quite new to Django.)
Change History (5)
comment:1 Changed 3 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Accepted|
|Type:||Uncategorized → Cleanup/optimization|
|Version:||1.6 → master|