#26562: Introduce Storage and FileSystemStorage alternate save behaviour
-------------------------------------+-------------------------------------
     Reporter:  freshquiz            |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  File                 |                  Version:  master
  uploads/storage                    |
     Severity:  Normal               |               Resolution:
     Keywords:  file FileField       |             Triage Stage:  Accepted
  storage overwrite filepath         |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by aaugustin):

 Replying to [comment:8 freshquiz]:
 > Yes, I am currently using this to implement the desired behaviour using
 subclasses, but there are two problems with putting the responsibility on
 the client:

 We're debating different ideas here, let's not mix them.

 I didn't suggest to let each project implement its own storage backend. I
 originally accepted the ticket and I said it would be useful for Django to
 provide the behavior you're describing natively.

 I also said that this behavior should be selected with the current
 configuration mechanism, the DEFAULT_FILE_STORAGE setting, not with an
 additional setting.

 In my opinion, it would be a net negative for Django to add an ad-hoc
 configuration mechanism just for this feature. Irregular configuration
 options are hard to discover and easy to misconfigure. I'd rather not have
 the feature requested in this ticket than have it controlled with a new
 setting. That's my opinion; of course others may disagree :-)

 > How do you propose introducing the behaviour natively as a non-default
 option, without breaking backwards compability and without a configuration
 option?

 There's a variety of ways to do this, the easiest being to add a
 `BaseStorage` or `SimpleStorage` or `OverwritingStorage` or
 `UnsafeStorage` class as a superclass of the current `Storage` class,
 which would keep its behavior. I'm happy to leave that part of the design
 to the person who writes the patch.

--
Ticket URL: <https://code.djangoproject.com/ticket/26562#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.f89dc257069c4ebd96751c555a45a44e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to