Refactor saving History obj
From import_history and parse_history. Also refactor getting CSV information from import_history.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1>{{ user_id }}'s Listening History</h1>
|
||||
<p> Found {{ total_history }} songs. </p>
|
||||
<a class="btn btn-primary " href="{% export_url 'csv' %}" role="button">Export</a>
|
||||
{% render_table user_history_table %}
|
||||
</body>
|
||||
|
||||
@@ -65,6 +65,7 @@ class HistoryList(ExportMixin, SingleTableView):
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['user_id'] = self.request.session['user_id']
|
||||
context['total_history'] = self.get_table_data().count()
|
||||
return context
|
||||
|
||||
def get_export_filename(self, export_format):
|
||||
|
||||
Reference in New Issue
Block a user