Ticket #7048: DeletableFileFields-00_docs.txt

File DeletableFileFields-00_docs.txt, 1.2 KB (added by , 16 years ago)

Docs as a simple text file as the docs refactor is going to land anyway ...

Line 
1Meta options
2============
3
4``files_add_delete_option``
5---------------------------
6
7This option is ``True`` by default.
8
9When set to ``True``, all ``FileField``s get delete checkboxes if they have the
10option ``blank=True``. The current file is also displayed above the field, regardless
11of the value of ``blank``.
12
13``files_delete_from_disk``
14---------------------------
15
16This option is ``True`` by default.
17
18When set to ``True``, files of ``FileField`` are deleted from the disk. This happens
19when a FileField is updated or when it is cleared. The latter is only possible if
20``files_add_delete_option`` is ``True``.
21
22``files_delete_empty_dirs``
23---------------------------
24
25This option is ``False`` by default.
26
27When set to ``True``, Django removes *empty* directories after each file is deleted. It
28starts with the directory of the file and then moves it's way up till it reaches the
29``MEDIA_ROOT`` folder. **Warning**: This may delete more directories than you want.
30Use with caution!
31
32For example, if Django deletes the following file:
33
34 /media-root/foo/bar/file.png
35
36It will first try to delete ``/media-root/foo/bar/`` and then ``/media-root/foo/``.
Back to Top