#8912: File storage and save/commit=False
---------------------------------------------+------------------------------
          Reporter:  shadfc                  |         Owner:  shadfc
            Status:  assigned                |     Milestone:        
         Component:  File uploads/storage    |       Version:  1.0   
        Resolution:                          |      Keywords:        
             Stage:  Design decision needed  |     Has_patch:  1     
        Needs_docs:  0                       |   Needs_tests:  1     
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Comment (by shadfc):

 The second patch, which I just added, is much simpler than the first and
 just modifies the save() and delete() methods on FieldFile (typo in the
 patch description says FileField).  It wont do anything permanent like
 calling the storage backend unless save=True.

 Since save() requires a name from the storage backend, I've changed that
 to use the original name passed to save() and add on "(unsaved)" to the
 end of it for clarity's sake.

 Now delete() really only closes the file.

 I think I prefer this implementation.  I don't see any real reason that a
 storage backend designer would want/need to know if save() was called with
 save=False.

 Also, just as a note, the first patch is incomplete because I only noticed
 delete()'s behavior after I had posted it here, so that patch only affects
 save() and _save() on various classes.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8912#comment:4>
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 django-updates@googlegroups.com
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