-
Notifications
You must be signed in to change notification settings - Fork 92
Description
When a user sees a snippet (most of them are not logged in or do not have an account), only the score count is displayed. Users read the snippet and, if interested, they definitely click on the download icon. However, users are not able to see how many downloads the snippet has.
The development server is installed on my system, and I am familiar with the code structure and technologies used.
I want to add a simple download count on the snippet so that it is transparent for everyone how many downloads a snippet currently has. This motivates both downloaders and snippet writers to add more snippets.
My approach:
1.) Create a column named download_count in cab_snippet.
2.) Identify the snippet ID clicked (getting the ID via a GET request).
3.) Add a line in the view function download_snippet
(cab_snippet.objects.get(id=id).download_count += 1)
Result:
