| 1 | Meta options
|
|---|
| 2 | ============
|
|---|
| 3 |
|
|---|
| 4 | ``files_add_delete_option``
|
|---|
| 5 | ---------------------------
|
|---|
| 6 |
|
|---|
| 7 | This option is ``True`` by default.
|
|---|
| 8 |
|
|---|
| 9 | When set to ``True``, all ``FileField``s get delete checkboxes if they have the
|
|---|
| 10 | option ``blank=True``. The current file is also displayed above the field, regardless
|
|---|
| 11 | of the value of ``blank``.
|
|---|
| 12 |
|
|---|
| 13 | ``files_delete_from_disk``
|
|---|
| 14 | ---------------------------
|
|---|
| 15 |
|
|---|
| 16 | This option is ``True`` by default.
|
|---|
| 17 |
|
|---|
| 18 | When set to ``True``, files of ``FileField`` are deleted from the disk. This happens
|
|---|
| 19 | when 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 |
|
|---|
| 25 | This option is ``False`` by default.
|
|---|
| 26 |
|
|---|
| 27 | When set to ``True``, Django removes *empty* directories after each file is deleted. It
|
|---|
| 28 | starts 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.
|
|---|
| 30 | Use with caution!
|
|---|
| 31 |
|
|---|
| 32 | For example, if Django deletes the following file:
|
|---|
| 33 |
|
|---|
| 34 | /media-root/foo/bar/file.png
|
|---|
| 35 |
|
|---|
| 36 | It will first try to delete ``/media-root/foo/bar/`` and then ``/media-root/foo/``.
|
|---|