Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.5.x] Fixed #19310 -- changed method docs formatting for custom fil…

…e storage docs
  • Loading branch information...
commit 11539aad1eb72ec9ec579f5440db90c4b0911283 1 parent 0aaaad1
Preston Holmes authored November 17, 2012

Showing 1 changed file with 8 additions and 11 deletions. Show diff stats Hide diff stats

  1. 19  docs/howto/custom-file-storage.txt
19  docs/howto/custom-file-storage.txt
@@ -27,9 +27,9 @@ You'll need to follow these steps:
27 27
                     option = settings.CUSTOM_STORAGE_OPTIONS
28 28
                 ...
29 29
 
30  
-#. Your storage class must implement the ``_open()`` and ``_save()`` methods,
31  
-   along with any other methods appropriate to your storage class. See below for
32  
-   more on these methods.
  30
+#. Your storage class must implement the :meth:`_open()` and :meth:`_save()
  31
+   methods, along with any other methods appropriate to your storage class. See
  32
+   below for more on these methods.
33 33
 
34 34
    In addition, if your class provides local file storage, it must override
35 35
    the ``path()`` method.
@@ -46,8 +46,7 @@ Your custom storage system may override any of the storage methods explained in
46 46
 You'll also usually want to use hooks specifically designed for custom storage
47 47
 objects. These are:
48 48
 
49  
-``_open(name, mode='rb')``
50  
-~~~~~~~~~~~~~~~~~~~~~~~~~~
  49
+.. method:: _open(name, mode='rb')
51 50
 
52 51
 **Required**.
53 52
 
@@ -56,8 +55,7 @@ uses to open the file. This must return a ``File`` object, though in most cases,
56 55
 you'll want to return some subclass here that implements logic specific to the
57 56
 backend storage system.
58 57
 
59  
-``_save(name, content)``
60  
-~~~~~~~~~~~~~~~~~~~~~~~~
  58
+.. method:: _save(name, content)
61 59
 
62 60
 Called by ``Storage.save()``. The ``name`` will already have gone through
63 61
 ``get_valid_name()`` and ``get_available_name()``, and the ``content`` will be a
@@ -67,8 +65,8 @@ Should return the actual name of name of the file saved (usually the ``name``
67 65
 passed in, but if the storage needs to change the file name return the new name
68 66
 instead).
69 67
 
70  
-``get_valid_name(name)``
71  
-~~~~~~~~~~~~~~~~~~~~~~~~
  68
+.. method:: get_valid_name(name)
  69
+
72 70
 
73 71
 Returns a filename suitable for use with the underlying storage system. The
74 72
 ``name`` argument passed to this method is the original filename sent to the
@@ -78,8 +76,7 @@ how non-standard characters are converted to safe filenames.
78 76
 The code provided on ``Storage`` retains only alpha-numeric characters, periods
79 77
 and underscores from the original filename, removing everything else.
80 78
 
81  
-``get_available_name(name)``
82  
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  79
+.. method:: get_available_name(name)
83 80
 
84 81
 Returns a filename that is available in the storage mechanism, possibly taking
85 82
 the provided filename into account. The ``name`` argument passed to this method

0 notes on commit 11539aa

Please sign in to comment.
Something went wrong with that request. Please try again.