1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #16833 -- Removed undocumented mixin parameter from the Storage.open() method as this was an undocumented and obscure feature. Thanks to Marty and Russell for sanity-checking.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16824 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-09-13 15:10:49 +00:00
parent 3513234cf8
commit f3ae496201
3 changed files with 27 additions and 28 deletions

View File

@@ -527,6 +527,30 @@ This functionality has been removed due to intractable performance and
security issues. Any existing usage of ``verify_exists`` should be
removed.
``django.core.files.storage.Storage.open``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``open`` method of the base Storage class took an obscure parameter
``mixin`` which allowed to dynamically change the base classes of the
returned file object. In the rare case you relied on the `mixin` parameter,
you can easily achieve the same by overriding the `open` method, e.g.::
from django.core.files import File
from django.core.files.storage import FileSystemStorage
class Spam(File):
"""
Spam, spam, spam, spam and spam.
"""
def ham(self):
return 'eggs'
class SpamStorage(FileSystemStorage):
"""
A custom file storage backend.
"""
def open(self, name, mode='rb'):
return Spam(open(self.path(name), mode))
.. _deprecated-features-1.4: