1
0
Fork 0
mirror of https://github.com/Findus23/acronomy.git synced 2024-09-19 15:33:45 +02:00
acronomy/acros/management/commands/refetch_wikipedia.py
2020-07-18 22:16:06 +02:00

17 lines
546 B
Python

from django.core.management.base import BaseCommand
from simple_history.utils import update_change_reason
from acros.models import WikipediaLink
class Command(BaseCommand):
help = 'Updates all Wikipedia articles'
def handle(self, *args, **options):
links = WikipediaLink.objects.all()
for link in links:
if link.fetched:
self.stdout.write(link.title)
link.fetched = False
# update_change_reason(link, "refetch_wikipedia command")
link.save()