#23405: Blank-able CharFields require default=''
----------------------------+--------------------------------------
     Reporter:  yuvadm      |                    Owner:  nobody
         Type:  Bug         |                   Status:  new
    Component:  Migrations  |                  Version:  1.7
     Severity:  Normal      |               Resolution:
     Keywords:              |             Triage Stage:  Unreviewed
    Has patch:  0           |      Needs documentation:  0
  Needs tests:  0           |  Patch needs improvement:  0
Easy pickings:  0           |                    UI/UX:  0
----------------------------+--------------------------------------
Changes (by charettes):

 * cc: charettes (added)


Comment:

 Replying to [comment:2 yuvadm]:
 > Of course I can add `''` as the default value. It just kind of goes
 against the usual convention that CharField should never be null and
 always use `''` as a default for null/blank values. It also goes against
 what South would do, that's the core of my confusion.

 I'd advocate the new behavior makes more sense. If I add a `status =
 models.CharField(max_length=20, blank=True)` field I might not want the
 existing rows of the altered table to be equals to `''` but a totally
 different value (e.g. `'active'`) even if it's not an explicit `default`
 value used by the application.

 I think Django should continue to prompt the user instead of guessing like
 South did.

--
Ticket URL: <https://code.djangoproject.com/ticket/23405#comment:3>
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/064.9f7894f56cbe96a9b7fdc8a21d211b45%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to