Move non-request functions in login/views to utils
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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 =
|
||||
|
||||
|
||||
Reference in New Issue
Block a user