Code review comment for lp:~dholbach/harvest/504299

Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks for the review and thanks for your sharp eye. The blank/null mis-match was in there for a long time.

"""
Field.null
If True, Django will store empty values as NULL in the database. Default is False.

Note that empty string values will always get stored as empty strings, not as NULL. Only use null=True for non-string fields such as integers, booleans and dates. For both types of fields, you will also need to set blank=True if you wish to permit empty values in forms, as the null parameter only affects database storage (see blank).

Avoid using null on string-based fields such as CharField and TextField unless you have an excellent reason. If a string-based field has null=True, that means it has two possible values for “no data”: NULL, and the empty string. In most cases, it’s redundant to have two possible values for “no data;” Django convention is to use the empty string, not NULL.

Field.blank
If True, the field is allowed to be blank. Default is False.

Note that this is different than null. null is purely database-related, whereas blank is validation-related. If a field has blank=True, validation on Django’s admin site will allow entry of an empty value. If a field has blank=False, the field will be required.
"""

In this branch I basically just changed the description and help_text of Opportunity.explanation. I'll file a separate bug about the null/blank mistake

« Back to merge proposal