Fix CD import
This commit is contained in:
parent
28eac94312
commit
3977ab9ec3
|
@ -3,7 +3,7 @@ from sys import stdin
|
||||||
|
|
||||||
from django.core.management import BaseCommand
|
from django.core.management import BaseCommand
|
||||||
|
|
||||||
from media.models import Auteur, Vinyle
|
from media.models import Auteur, CD
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
@ -27,12 +27,12 @@ class Command(BaseCommand):
|
||||||
if len(cd) != 3:
|
if len(cd) != 3:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
side = cd[0]
|
title = cd[0]
|
||||||
title = cd[1]
|
side = cd[1]
|
||||||
authors_str = cd[2].split('|')
|
authors_str = cd[2].split('|')
|
||||||
authors = [Auteur.objects.get_or_create(name=author)[0]
|
authors = [Auteur.objects.get_or_create(name=author)[0]
|
||||||
for author in authors_str]
|
for author in authors_str]
|
||||||
cd, created = Vinyle.objects.get_or_create(
|
cd, created = CD.objects.get_or_create(
|
||||||
title=title,
|
title=title,
|
||||||
side_identifier=side,
|
side_identifier=side,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue