Ticket #3328: imply_blank.patch

File imply_blank.patch, 1.6 KB (added by Chris Beaven, 18 years ago)

patch, including doc

  • django/db/models/fields/__init__.py

     
    6666    creation_counter = 0
    6767
    6868    def __init__(self, verbose_name=None, name=None, primary_key=False,
    69         maxlength=None, unique=False, blank=False, null=False, db_index=False,
     69        maxlength=None, unique=False, blank=None, null=False, db_index=False,
    7070        core=False, rel=None, default=NOT_PROVIDED, editable=True,
    7171        prepopulate_from=None, unique_for_date=None, unique_for_month=None,
    7272        unique_for_year=None, validator_list=None, choices=None, radio_admin=None,
     
    7575        self.verbose_name = verbose_name
    7676        self.primary_key = primary_key
    7777        self.maxlength, self.unique = maxlength, unique
     78        if blank is None:
     79            blank = null
    7880        self.blank, self.null = blank, null
    7981        self.core, self.rel, self.default = core, rel, default
    8082        self.editable = editable
  • docs/model-api.txt

     
    451451``blank``
    452452~~~~~~~~~
    453453
    454 If ``True``, the field is allowed to be blank.
     454If ``True``, the field is allowed to be blank. Defaults to the same value
     455as the ``null`` argument (which defaults to ``False``).
    455456
    456457Note that this is different than ``null``. ``null`` is purely
    457458database-related, whereas ``blank`` is validation-related. If a field has
Back to Top