Song reporting and user stats

This commit is contained in:
Olaf Slomp
2018-12-14 16:59:44 +01:00
committed by Daan Sprenkels
parent 0c1f9cb08d
commit f6fcc63450
17 changed files with 381 additions and 47 deletions

View File

@ -0,0 +1,14 @@
from django.conf import settings
from django.core.management.base import BaseCommand
from songs.models import ReportNote
class Command(BaseCommand):
help = 'Gather all song reports'
def handle(self, *args, **options):
reports = ReportNote.objects.all()
for report in reports:
song = report.song
url = '<{base_url}/admin/songs/song/{r.song.id}/change/>'.format(base_url=settings.BASE_URL, r=report)
print('Song: {r.song.artist} - {r.song.title}\nMessage: {r.note}\nLink: {url}'.format(url=url, r=report))
print('-' * 72)