Graphs and tables for your Spotify account.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
774 B

  1. import django_tables2 as tables
  2. from pprint import pprint
  3. from login.models import User
  4. from api.models import History
  5. class HistoryTable(tables.Table):
  6. class Meta:
  7. model = History
  8. template_name = 'django_tables2/bootstrap.html'
  9. iso_timestamp = tables.Column(accessor='get_iso_timestamp', orderable=False)
  10. track_id = tables.Column(accessor='track.id', orderable=False)
  11. track_name = tables.Column(accessor='track.name', orderable=False)
  12. artists = tables.Column(accessor='get_artists', orderable=False)
  13. def get_secret_context(user_secret):
  14. """Return user_secret in context for graph pages.
  15. :user_secret: User secret to put in context.
  16. :returns: context with user secret.
  17. """
  18. return { 'user_secret': user_secret, }