django-storages
django-storages copied to clipboard
Add FileSystemOverwriteStorage
Improved implementation of #1209
Background:
This ticket is going in loops:
Refer https://code.djangoproject.com/ticket/28144
I guess django-storages apparently did once have this class, and it was removed.
Per that above ticket, Django later added a fix to make it possible to override the not-overwriting behaviour (an OS_OPEN_FLAGS attribute)
Looks like there was (a LONG time ago) some discussion about including this feature in Django: https://code.djangoproject.com/ticket/4339 (it was closed wontfix due to the trivial nature of a custom implementation)
So, that puts us back here - we need somewhere to store that custom implementation, and django-storages seems like the right project for the job...
I've added a test and some basic docs (I don't think much is required, since there's no special configuration etc, unlike the other backends)
any chance of a review here?
I'm happy to accept this but am a bit concerned about drift from core.
As an example get_available_name has already drifted because validte_file_name is not called.
This one seems likely to land into upstream so going to close here.
See: https://github.com/django/django/pull/18020