django-storages icon indicating copy to clipboard operation
django-storages copied to clipboard

Add FileSystemOverwriteStorage

Open craigds opened this issue 2 years ago • 2 comments
trafficstars

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)

craigds avatar May 22 '23 08:05 craigds

any chance of a review here?

craigds avatar Feb 13 '24 19:02 craigds

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.

jschneier avatar Feb 14 '24 03:02 jschneier

This one seems likely to land into upstream so going to close here.

See: https://github.com/django/django/pull/18020

jschneier avatar Apr 25 '24 02:04 jschneier