Setup django_tables2 for user history table

This commit is contained in:
2018-11-06 15:23:43 -05:00
parent b4ffddb24d
commit 2912977992
8 changed files with 53 additions and 11 deletions

View File

@@ -102,7 +102,7 @@ class History(models.Model):
track = models.ForeignKey(Track, on_delete=models.CASCADE)
def __str__(self):
return (self.user, self.time, self.track)
return " - ".join((str(self.user), str(self.timestamp), str(self.track)))
# }}} #

View File

@@ -19,6 +19,8 @@ from dateutil.parser import parse
# }}} imports #
# constants {{{ #
USER_TRACKS_LIMIT = 50
HISTORY_LIMIT = 50
ARTIST_LIMIT = 50
@@ -31,6 +33,8 @@ HISTORY_ENDPOINT = 'https://api.spotify.com/v1/me/player/recently-played'
console_logging = True
# console_logging = False
# }}} constants #
# parse_library {{{ #
def parse_library(request, user_secret):