1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-06-29 19:51:08 +02:00

Ajout des CD et des vinyles

This commit is contained in:
Yohann D'ANELLO
2020-05-22 18:04:41 +02:00
parent 001f40a033
commit 054865cd41
7 changed files with 82 additions and 24 deletions

View File

@ -1,7 +1,9 @@
from time import sleep
from django.core.management import BaseCommand
from media.forms import MediaAdminForm
from media.models import Manga, Media
from media.models import BD, Manga
class Command(BaseCommand):
@ -13,7 +15,11 @@ class Command(BaseCommand):
def handle(self, *args, **options):
converted = 0
for media in Media.objects.all():
for media in BD.objects.all():
if media.pk < 3400:
continue
# We sleep 5 seconds to avoid a ban from Bedetheque
sleep(5)
self.stdout.write(str(media))
form = MediaAdminForm(instance=media,
data={"isbn": media.isbn, "_isbn": True, })