mirror of
https://github.com/Findus23/acronomy.git
synced 2024-09-19 15:33:45 +02:00
20 lines
535 B
Python
20 lines
535 B
Python
import time
|
|
|
|
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:
|
|
print(link)
|
|
self.stdout.write(link.title)
|
|
link.fetched = False
|
|
# update_change_reason(link, "refetch_wikipedia command")
|
|
link.clean()
|
|
link.save()
|
|
time.sleep(1)
|