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

Drop unusued models. Keep migration script, but this is now unusable

This commit is contained in:
2021-11-02 12:55:03 +01:00
parent b0a1602ea2
commit faf697d3cf
2 changed files with 66 additions and 2 deletions

View File

@ -1,8 +1,7 @@
from django.core.management import BaseCommand
from django.db import transaction
from django.utils.translation import gettext_lazy as _
from media.models import CD, Comic, Game, Manga, Novel, Review, Vinyl, \
OldCD, OldComic, OldGame, OldManga, OldNovel, OldReview, OldVinyl
from media.models import CD, Comic, Game, Manga, Novel, Review, Vinyl
from tqdm import tqdm
@ -17,6 +16,13 @@ class Command(BaseCommand):
@transaction.atomic
def handle(self, *args, **options): # noqa: C901
self.stderr.write(self.style.WARNING(
"Old data structure has been deleted. This script won't work "
"anymore (and is now useless)"))
from media.models import OldCD, OldComic, OldGame, OldManga, OldNovel, \
OldReview, OldVinyl
# Migrate books
for old_book_class, book_class in [(OldComic, Comic),
(OldManga, Manga),