#23405: Blank-able CharFields require default=''
----------------------------+------------------------------------
     Reporter:  yuvadm      |                    Owner:  coldmind
         Type:  Bug         |                   Status:  assigned
    Component:  Migrations  |                  Version:  1.7
     Severity:  Normal      |               Resolution:
     Keywords:              |             Triage Stage:  Accepted
    Has patch:  1           |      Needs documentation:  0
  Needs tests:  0           |  Patch needs improvement:  0
Easy pickings:  0           |                    UI/UX:  0
----------------------------+------------------------------------

Comment (by coldmind):

 Replying to [comment:18 andrewgodwin]:
 > Thinking about this again, `needs_default` isn't quite enough as you
 also need to give the database a default value to work with when there's
 none provided, and we don't have provision for that; plus, the schema
 backends aren't clever enough to check for this (currently, they use
 field.empty_strings_allowed).
 >
 > Thus, the patch should probably just fix the autodetector to skip fields
 with `empty_strings_allowed` declared, which should get the intended
 result.

 I'have updated PR.
 But I'm doubt if autodetector should skip field, if the check is only `if
 field.empty_strings_allowed`, or `if field.blank and
 field.empty_strings_allowed` (to reproduce South behavior in that case)

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

Reply via email to