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.

22 lines
630 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. track_name = tables.Column(accessor='get_track_name', orderable=False)
  10. artists = tables.Column(accessor='get_artists', orderable=False)
  11. def get_secret_context(user_secret):
  12. """Return user_secret in context for graph pages.
  13. :user_secret: User secret to put in context.
  14. :returns: context with user secret.
  15. """
  16. return { 'user_secret': user_secret, }