Playlist maker wip
This commit is contained in:
+5
-2
@@ -7,7 +7,7 @@ from django.db.models import Avg
|
||||
from django.urls import reverse
|
||||
import re
|
||||
from collections import OrderedDict
|
||||
from .models import Track, Artist, Album, Vote, Background, Profile
|
||||
from .models import Track, Artist, Album, Vote, Background, Profile, Playlist
|
||||
from .utils import from_json, get_unvoted
|
||||
from .spotify import spt
|
||||
from .tasks import get_banter, get_and_dither_image
|
||||
@@ -201,12 +201,15 @@ class OverView(LoginRequiredMixin, View):
|
||||
|
||||
class PlaylistListView(LoginRequiredMixin, View):
|
||||
def get(self, request, count=None):
|
||||
context = {
|
||||
"playlists": Playlist.objects.all()
|
||||
}
|
||||
return TemplateResponse(request, "PlaylistList.html", context)
|
||||
def post(self, request):
|
||||
name = self.request.POST.get('name', None)
|
||||
if name:
|
||||
new_playlist = Playlist(name=name)
|
||||
return TemplateResponse(request, "PlaylistList.html", context)
|
||||
return TemplateResponse(request, "PlaylistList.html")
|
||||
return self.get(request, count=count)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user