#10244: FileFields can't be set to NULL in the db
-------------------------------------+-------------------------------------
     Reporter:  oyvind               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.0
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  filefield NULL       |      Needs documentation:  0
  empty                              |  Patch needs improvement:  0
    Has patch:  0                    |                    UI/UX:  0
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

 * ui_ux:   => 0
 * easy:   => 0
 * stage:  Design decision needed => Accepted


Comment:

 I see two possible solutions:
 - 1. document that `FileField` ignores the `null` keyword argument; this
 is the most backwards compatible solution;
 - 2. make `FileField` behave exactly like `CharField` wrt. `null`; this is
 the most consistent solution.

 Option 2. will be backwards incompatible only for people who set
 `null=True` on a `FileField`. The docs discourage that heavily, and it
 doesn't behave as expected, actually it doesn't even do anything, so there
 isn't much reason to have such code. That's why I think the change would
 be acceptable.

 I have a slight preference for option 2, which is better in the long term.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/10244#comment:7>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to