Move non-request functions in login/views to utils

This commit is contained in:
2018-11-06 21:35:14 -05:00
parent b2990b45ee
commit 77141849ac
5 changed files with 71 additions and 56 deletions

View File

@@ -10,6 +10,7 @@
</head>
<body>
<h1>{{ user_id }}'s Listening History</h1>
<a class="btn btn-primary disabled" href="" role="button">Export CSV</a>
{% render_table user_history_table %}
</body>
</html>

View File

@@ -12,7 +12,7 @@ from datetime import datetime
from django.shortcuts import render, redirect
from .utils import *
from django_tables2 import RequestConfig
from django_tables2 import RequestConfig, SingleTableView
from api.models import History
# }}} imports #
@@ -61,3 +61,9 @@ def display_history_table(request, user_secret):
return render(request, "graphs/user_history.html", context)
class HistoryList(SingleTableView):
"""Create table with list of song history."""
model = History
table_class = HistoryTable
# table_data =