#4339: Override an existing file, using Model.save_FIELD_file method,
---------------------------------------------------+------------------------
          Reporter:  elaat...@gmail.com            |         Owner:  Gulopine   
            
            Status:  reopened                      |     Milestone:             
            
         Component:  Database layer (models, ORM)  |       Version:  SVN        
            
        Resolution:                                |      Keywords:  FileField 
db fs-rf-docs
             Stage:  Design decision needed        |     Has_patch:  1          
            
        Needs_docs:  1                             |   Needs_tests:  0          
            
Needs_better_patch:  1                             |  
---------------------------------------------------+------------------------
Comment (by elaatifi):

 With Django's new file access API there is more flexibity to deal with
 such problems.

 I think it's not a good idea to override get_available_name since it's a
 public methode
 that shouldn't have a side effect (I suppose) due to his name

 {{{class OverwriteStorage(FileSystemStorage):
     def _save(self, name, content):
         if self.exists(name):
             self.delete(name)
         return super(OverwriteStorage, self)._save(name, content)
 }}}

 Thank you

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