Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to not trigger a download #81

Merged
merged 2 commits into from
Mar 3, 2014

Conversation

quietlyconfident
Copy link
Contributor

Responsive to Issue #80.

@benoitbryon
Copy link
Collaborator

Hi @quietlyconfident, and thanks for the pull-request!

What about the following changes?

  • move Serving a file inline rather than as a download section from docs/views/object.txt to docs/views/custom.txt, just like the "Handling http not modified responses" section. The attachment option is inherited from DownloadMixin, so it is available for every "*DownloadView" (not only ObjectDownloadView). I think it should be documented along with DownloadMixin.
  • in docs/views/*.txt (except docs/views/custom.txt) add a link such as "You can also use attributes and methods inherited from DownloadMixin" (feel free to change the wording) which points to docs/views/custom.txt. So that the content you added in "docs/views/object.txt" does not completely disappears from the page: it is replaced by a link, and users who focus on ObjectDownloadView still have the information.
  • add a test for inline_file_view() in demo/demoproject/object/tests.py
  • add yourself in AUTHORS ;) Or perhaps https://github.com/benoitbryon/django-downloadview/graphs/contributors is enough?

@@ -61,6 +61,18 @@ Then here is the code to serve "another_file" instead of the default "file":
:language: python
:lines: 1-5, 10-12

***********************************************
Serving a file inline rather than as a download
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "attachment" more pertinent than "download" here?

@benoitbryon benoitbryon added this to the 1.6 milestone Feb 11, 2014
@benoitbryon benoitbryon modified the milestone: 1.6 Feb 11, 2014
@@ -16,3 +16,8 @@
deserialized_basename_view = ObjectDownloadView.as_view(
model=Document,
basename_field='basename')

#: Serve ``file`` attribute of ``Document`` model, inline rather than as attachment
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flake8 reports: "line too long (83 > 79 characters)".
See https://travis-ci.org/benoitbryon/django-downloadview/jobs/18602404#L49

What about #: Serve ``file`` attribute of ``Document`` model, inline (not as attachment).
Or span the comment on 2 lines :)

@benoitbryon benoitbryon merged commit 21cb8f6 into jazzband:master Mar 3, 2014
@benoitbryon benoitbryon self-assigned this Mar 3, 2014
@benoitbryon
Copy link
Collaborator

Hi @quietlyconfident,
I updated and merged the pull-request in #83.
And just released version 1.6 :)
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants