From d48a3d90528c5df89fbfd4368a141b4e3c6ecdd3 Mon Sep 17 00:00:00 2001 From: Benoit Bryon Date: Mon, 27 Aug 2012 17:25:24 +0200 Subject: [PATCH] Promoted ObjectDownloadView instead of DownloadView in README. --- README | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/README b/README index b793902..8ec1d57 100644 --- a/README +++ b/README @@ -11,14 +11,18 @@ Django-DownloadView provides (class-based) generic download views for Django. Example, in some urls.py: -:: +.. code-block:: python - >>> from django.conf.urls import url, url_patterns - >>> from django_downloadview import DownloadView - >>> download = DownloadView.as_view(file='path/to/file.pdf') - >>> url_patterns = ( - ... url('^download/file.pdf$', download, name='download'), - ... ) + from django.conf.urls import url, url_patterns + from django_downloadview import ObjectDownloadView + from demoproject.download.models import Document # A model with a FileField. + + + download = ObjectDownloadView.as_view(model=Document, file_attribute='file') + + url_patterns = ('', + url('^download/file.pdf$', download, name='download'), + ) **********