I added a patch which attempts to achieve a similar purpose without changing the overal behavior of FileField in a more destructive manner. The reasoning behind the patch is simple. The current code defines the following behavior: when an instance of a model is deleted, the file will also be deleted if the deleted instance was the only instance which referenced this file. Hence, the curent code is already destructive when there are no more rows which reference the file. This makes sense to me, and additionally it follows logically (IMHO) that the code should do the same thing when a new file is uploaded. If the new file upload is named the same as the old one, it'll be an effective overwrite. If not, it'll just remove a file from the filesystem that would otherwise be unreferenced and not manageable from the admin. Additionally, if there are other instances that reference the same file, it will still be preserved. (Retaining the non-destructive behavior).
Lakin On Dec 4, 9:54 am, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On Dec 4, 2007 11:46 AM, Marc Garcia <[EMAIL PROTECTED]> wrote: > > > I agree on not commiting patches to a module that will be rewrite > > soon. I hope that you find the way to allow that feature on new > > version. > > I guarantee you it'll be possible. I just hate how ugly it'll look, > unless I find a way to reorganize. > > -Gul --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@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-developers?hl=en -~----------~----~----~----~------~----~------~--~---