diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-09-03 20:27:54 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-09-03 20:27:54 +0000 |
| commit | 62fc1553433b6b962ebf40d08f85a252de728af9 (patch) | |
| tree | 115da74450425260a4edb23e7e92bbf3525839ca /docs | |
| parent | 5697f87914406b070d47bab45e0137337a0fb746 (diff) | |
Fixed #8848: clarified custom file storage backend docs in light of the more clear code comments.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8942 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/howto/custom-file-storage.txt | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/docs/howto/custom-file-storage.txt b/docs/howto/custom-file-storage.txt index c5f6b740a8..776658e2a7 100644 --- a/docs/howto/custom-file-storage.txt +++ b/docs/howto/custom-file-storage.txt @@ -3,6 +3,8 @@ Writing a custom storage system =============================== +.. currentmodule:: django.core.files.storage + If you need to provide custom file storage -- a common example is storing files on some remote system -- you can do so by defining a custom storage class. You'll need to follow these steps: @@ -35,8 +37,16 @@ You'll need to follow these steps: the ``path()`` method. Your custom storage system may override any of the storage methods explained in -:ref:`ref-files-storage`. However, it's usually better to use the hooks -specifically designed for custom storage objects. These are: +:ref:`ref-files-storage`, but you **must** implement the following methods: + + * :meth:`Storage.delete` + * :meth:`Storage.exists` + * :meth:`Storage.listdir` + * :meth:`Storage.size` + * :meth:`Storage.url` + +You'all also usually want to use hooks specifically designed for custom storage +objects. These are: ``_open(name, mode='rb')`` ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
