diff options
| author | Ben Cail <bcail@crossway.org> | 2024-03-26 11:25:29 -0400 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-05-21 07:28:12 +0200 |
| commit | 0b33a3abc2ca7d68a24f6d0772bc2b9fa603744e (patch) | |
| tree | e2e191d205a51a64ef9124e2eaa5a51c352f7eb6 /docs | |
| parent | 6c48eed2383eb50191b59a64036b75cb46ae178e (diff) | |
Fixed #35326 -- Added allow_overwrite parameter to FileSystemStorage.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 3 | ||||
| -rw-r--r-- | docs/ref/files/storage.txt | 9 | ||||
| -rw-r--r-- | docs/releases/5.1.txt | 11 |
3 files changed, 21 insertions, 2 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index c0965f676b..4f89481ac7 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -79,6 +79,9 @@ details on these changes. * The ``check`` keyword argument of ``CheckConstraint`` will be removed. +* The ``OS_OPEN_FLAGS`` attribute of + :class:`~django.core.files.storage.FileSystemStorage` will be removed. + .. _deprecation-removed-in-5.1: 5.1 diff --git a/docs/ref/files/storage.txt b/docs/ref/files/storage.txt index 2ebf49b9aa..e912bcc412 100644 --- a/docs/ref/files/storage.txt +++ b/docs/ref/files/storage.txt @@ -28,7 +28,7 @@ Django provides convenient ways to access the default storage class: The ``FileSystemStorage`` class =============================== -.. class:: FileSystemStorage(location=None, base_url=None, file_permissions_mode=None, directory_permissions_mode=None) +.. class:: FileSystemStorage(location=None, base_url=None, file_permissions_mode=None, directory_permissions_mode=None, allow_overwrite=False) The :class:`~django.core.files.storage.FileSystemStorage` class implements basic file storage on a local filesystem. It inherits from @@ -60,6 +60,13 @@ The ``FileSystemStorage`` class The file system permissions that the directory will receive when it is saved. Defaults to :setting:`FILE_UPLOAD_DIRECTORY_PERMISSIONS`. + .. attribute:: allow_overwrite + + .. versionadded:: 5.1 + + Flag to control allowing saving a new file over an existing one. + Defaults to ``False``. + .. method:: get_created_time(name) Returns a :class:`~datetime.datetime` of the system's ctime, i.e. diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt index 2def385f98..7579cc732f 100644 --- a/docs/releases/5.1.txt +++ b/docs/releases/5.1.txt @@ -210,7 +210,10 @@ Error Reporting File Storage ~~~~~~~~~~~~ -* ... +* The :attr:`~django.core.files.storage.FileSystemStorage.allow_overwrite` + parameter has been added to + :class:`~django.core.files.storage.FileSystemStorage`, to allow saving new + files over existing ones. File Uploads ~~~~~~~~~~~~ @@ -467,6 +470,12 @@ Miscellaneous * The ``check`` keyword argument of ``CheckConstraint`` is deprecated in favor of ``condition``. +* The undocumented ``OS_OPEN_FLAGS`` property of + :class:`~django.core.files.storage.FileSystemStorage` has been deprecated. + To allow overwriting files in storage, set the new + :attr:`~django.core.files.storage.FileSystemStorage.allow_overwrite` option + to ``True`` instead. + Features removed in 5.1 ======================= |
