forked from jazzband/django-downloadview
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced narrative overview of available download views in document…
…ation.
- Loading branch information
1 parent
7876cff
commit 5c91a53
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ Contents | |
|
||
demo | ||
install | ||
views | ||
optimizations/index | ||
api/index | ||
about/index | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
############## | ||
Download views | ||
############## | ||
|
||
This section contains narrative overview about class-based views provided by | ||
django-downloadview. | ||
|
||
|
||
**************** | ||
PathDownloadView | ||
**************** | ||
|
||
The :py:class:`django_downloadview.views.PathDownloadView` class-based view | ||
allows you to **serve files given an absolute path on local filesystem**. | ||
|
||
Two main use cases: | ||
|
||
* as a shortcut. This dead-simple view is straight to call, so you can use it | ||
to simplify code in more complex views, provided you have an absolute path to | ||
a local file. | ||
|
||
* override. Extend :py:class:`django_downloadview.views.PathDownloadView` and | ||
override :py:meth:`django_downloadview.views.PathDownloadView:get_path`. | ||
|
||
|
||
****************** | ||
ObjectDownloadView | ||
****************** | ||
|
||
The :py:class:`django_downloadview.views.ObjectDownloadView` class-based view | ||
allows you to **serve files given a model with some file fields** such as | ||
FileField or ImageField. | ||
|
||
Use this view anywhere you could use Django's builtin ObjectDetailView. | ||
|
||
Some options allow you to store file metadata (size, content-type, ...) in the | ||
model, as deserialized fields. |