After some more searching of the current 1.2 tickets, #7048 [1] seems
like it does the job. It has a kind of goofy option for deleting
empty directories when removing a file leaves said directory empty.
If this were merged together with the existing models.FileField class,
it would perfectly fix what I suggest be done.
As the author of the patch says:
> Currently ... blank=True on FileFields currently means "blank
first, then set forever".
> Which is a not the most common use case IMHO ;)
The patch is marked as "Accepted", but there's some discussion on the
comments about "deleting files" not being within the scope of what the
patch should do. I think the intended suggestion is that the patch
should clear the DB field pointing to the file, yet not remove the
file itself.
Which sort of lands us back at the initial discussion I brought up in
the first post. Now, for the record, I'm totally against an option
for removing directories. That most certainly intrudes on the file
system far more than acceptable. It's far from a required feature for
the Django core, and has a rare use case at best. But, as for the
basic file clearing and deletion, it doesn't seem to me that it ever
was discussed beyond the ticket comments, or anything else I've found
yet.
So once again, in summary, I'd like to petition for something of a
conclusive decision about file deletion, this time on the above-noted
patch. The ticket comments mention that it would be too late for
introducing a feature like that into the development cycle, but that
looks like it was from the 1.1 days. I don't want something like this
to slip beyond the end of December, and then have it ignored until a
1.3-ish release.
It looks like Jacob had the eyes that looked over the ticket last
significant update. Any thoughts, Jacob or anyone else?
Tim
[1] http://code.djangoproject.com/ticket/7048
On Nov 21, 6:18 pm, Alexander Schepanovski <[email protected]> wrote:
> I agree, currently I am deleting old file in view handling form, which
> does not feel right. I also need to check for upload errors and in
> case of ImageField if it's a valid image, which feels really wrong
> since the field is doing it on itself
--
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers?hl=.