mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 20:02:20 +01:00
17 lines
596 B
Python
17 lines
596 B
Python
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)
|