#26168: Django forcibly allow BooleanField blank
----------------------------------------------+--------------------------
     Reporter:  fengyehong                    |      Owner:  nobody
         Type:  Uncategorized                 |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  master
     Severity:  Normal                        |   Keywords:  BooleanField
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+--------------------------
 https://github.com/django/django/tree/master/django/db/models/fields#L1017

 {{{
     def __init__(self, *args, **kwargs):
         kwargs['blank'] = True
         super(BooleanField, self).__init__(*args, **kwargs)
 }}}

 blank is set to True forcibly

 I want my BooleanField always explicitly set(without a default value),
 like this:

 {{{
 myflag = models.BooleanField(blank=False)
 }}}

 but with this `kwargs['blank'] =True`, Django does not complain if field
 `myflag` not set, but try to use default of BooleanField(in 1.7.5, None)
 which lead to exception when saving~

 I think force blank = True makes sense for NullBooleanField, but for
 BooleanField, we can leave it to user.

 Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/26168>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.b1e0eba4ff48c572813edfea68b357a2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to