#7048: Support clearing FileFields in the admin if blank=True
--------------------------------------+-------------------------------------
          Reporter:  jarrow           |         Owner:  jarrow
            Status:  new              |     Milestone:  1.0   
         Component:  Admin interface  |       Version:  SVN   
        Resolution:                   |      Keywords:        
             Stage:  Accepted         |     Has_patch:  1     
        Needs_docs:  0                |   Needs_tests:  1     
Needs_better_patch:  0                |  
--------------------------------------+-------------------------------------
Changes (by jarrow):

  * has_patch:  0 => 1
  * needs_tests:  0 => 1

Comment:

 After talking to brosner on #django-dev we decided to implement this on
 the ModelForm level. The attached patch introduces file deletion
 functionality for ModelForms which can be customized via its Meta class
 (see attached docs).

 Work still to be done:

  * Check admin CSS
    * at least for the RTL design this is bound to break
    * what about inlines?
  * Fix regression tests
  * Write new tests ;)

 Notes on the patch:

  * I had to add some special admin CSS to align everything properly. That
 can only be achieved with a fixed padding to the left ...
  * For the DeletableFileField I started with a MultiValueField till i had
 overwritten every piece of code in it ... now it just sublcasses Field.
 The widget still subclasses MultiWidget though.
  * The display of the current file moved from the admin to ModelForm. It
 just doesn't make sense to provide a delete option if the presence of a
 file isn't visible ;)

 If I missed anything in this short description let me know. Please test
 and tell me what breaks I'll keep the patch up to date :)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7048#comment:12>
Django Code <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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to