#4979: Admin does not allow removal of an image from an ImageField after it has
been set, even if null=True and blank=True
-------------------------------------------+--------------------------------
          Reporter:  robvdl                |         Owner:  nobody    
            Status:  reopened              |     Milestone:            
         Component:  django.contrib.admin  |       Version:  SVN       
        Resolution:                        |      Keywords:  ImageField
             Stage:  Accepted              |     Has_patch:  1         
        Needs_docs:  0                     |   Needs_tests:  0         
Needs_better_patch:  1                     |  
-------------------------------------------+--------------------------------
Changes (by Daniel Pope <d...@mauveinternet.co.uk>):

  * needs_better_patch:  0 => 1
  * has_patch:  0 => 1

Comment:

 I've added an initial patch - needs a bit of cleaning up as I've made a
 bit of a mess wrt PEP8 so I will reupload in a moment.

 In this patch I've taken the approach of False indicating a file
 explicitly unset, None indicating no new value. I don't particularly like
 that approach, but {{{FileField}}} is special-cased at the model, form and
 form field level so it defaults to preserving the current value. A cleaner
 approach might be to remove the special case that makes it default to
 preserving a value, and have {{{FileField}}} explicitly return the same
 file. But that would mean more upheaval, less compatibility.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/4979#comment:6>
Django <http://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