In light of ticket #11663 (http://code.djangoproject.com/ticket/ 11663), and the consequent discussion on a thread on this group (http://groups.google.com/group/django-developers/browse_thread/thread/ 491619541ba6ac75).... it doesn't seem like there was any resolution on the topic of having an optional keyword argument to automatically remove a file when "replaced" via a new upload.
I understand the point of view concerning the impossible knowing of the file being "free" for removal. But... Is there any opposition to getting innovative with this? In Malcom's words (taken from the previous thread, linked above): > So knowing when it is safe to delete files requires domain-specific > knowledge. This is true, but, aren't *I* the one to give such a commission to the FileField? It seems to me that I, as the developer and maintainer of the server, should be able to provide instructions to the FileField which constitute such "domain-specific knowledge." If Django goes and tries to delete a file, but can't, then would it be design-acceptable to have methods for dealing with the exception? A default catcher could just append those underscores like normal. Ultimately, I fail to see the difference between Django having an option for *trying* to delete the file automatically, and me going and hacking up the silly thing just to make it naively delete the file anyway. Omitting this functionality doesn't really "solve" any real- world problem. It simply refuses to make a decision about the *existing* real-world problem of wanting to depend on a path to provide a predictable filename. Anyway, I don't want to go on and on for nothing. If there's any more info on this topic, I'd be welcome to reading more discussions or tickets. I'm rather in favor of having a declared spot for this exception check to happen, so that it's officially documented where a file delete / rename should happen. Doing this on the outside of the code just feels sloppy, no matter how I approach it. Suggestions welcome. Tim -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=.