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

21 lines
535 B
Python
Raw Normal View History

2023-03-21 23:24:52 +01:00
import time
2020-06-08 18:45:38 +02:00
from django.core.management.base import BaseCommand
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:
2023-03-21 23:24:52 +01:00
print(link)
self.stdout.write(link.title)
link.fetched = False
# update_change_reason(link, "refetch_wikipedia command")
link.clean()
link.save()
time.sleep(1)