diff --git a/sample-track-obj.json b/sample-track-obj.py similarity index 100% rename from sample-track-obj.json rename to sample-track-obj.py diff --git a/spotifyvis/templates/spotifyvis/test_db.html b/spotifyvis/templates/spotifyvis/test_db.html index 0f481bd..59636c9 100644 --- a/spotifyvis/templates/spotifyvis/test_db.html +++ b/spotifyvis/templates/spotifyvis/test_db.html @@ -1,3 +1,5 @@ + + @@ -11,15 +13,94 @@ + + diff --git a/spotifyvis/utils.py b/spotifyvis/utils.py index f58f549..e823eaa 100644 --- a/spotifyvis/utils.py +++ b/spotifyvis/utils.py @@ -406,7 +406,8 @@ def get_artists_in_genre(user, genre): .filter(track__genre=genre) .annotate(num_songs=Count('track', distinct=True)) ) - processed_artist_counts = [{'name': artist.name, 'num_songs': artist.num_songs} for artist in artist_counts] + # processed_artist_counts = [{'name': artist.name, 'num_songs': artist.num_songs} for artist in artist_counts] + processed_artist_counts = {artist.name: artist.num_songs for artist in artist_counts} # pprint.pprint(processed_artist_counts) return processed_artist_counts