Fixed #28184 -- Allowed using a callable for FileField and ImageField storage.

This commit is contained in:
miigotu 2020-03-31 12:12:39 +02:00 committed by Carlton Gibson
parent db6933a032
commit 210657b791
7 changed files with 105 additions and 4 deletions

View file

@ -822,8 +822,13 @@ Has two optional arguments:
.. attribute:: FileField.storage
A storage object, which handles the storage and retrieval of your
files. See :doc:`/topics/files` for details on how to provide this object.
A storage object, or a callable which returns a storage object. This
handles the storage and retrieval of your files. See :doc:`/topics/files`
for details on how to provide this object.
.. versionchanged:: 3.1
The ability to provide a callable was added.
The default form widget for this field is a
:class:`~django.forms.ClearableFileInput`.