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:
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user