|
|
|
@ -6,20 +6,20 @@ from datetime import datetime |
|
|
|
|
|
|
|
|
|
|
|
class Command(BaseCommand): |
|
|
|
help = "Importa la lista de letras" |
|
|
|
help = "Importa la lista de letras" |
|
|
|
|
|
|
|
def add_arguments(self, parser): |
|
|
|
parser.add_argument("fichero_csv", type=str, help='Ruta al fichero csv') |
|
|
|
def add_arguments(self, parser): |
|
|
|
parser.add_argument("fichero_csv", type=str, help='Ruta al fichero csv') |
|
|
|
|
|
|
|
def handle(self, *args, **options): |
|
|
|
fichero = options["fichero_csv"] |
|
|
|
with open(fichero, 'r') as file: |
|
|
|
reader = csv.DictReader(file) |
|
|
|
for row in reader: |
|
|
|
title = row['title'], |
|
|
|
artist = row['artist'], |
|
|
|
album = row['album'], |
|
|
|
year = row['year'], |
|
|
|
lyrics = row['lyrics'] |
|
|
|
pista = row['pista'] |
|
|
|
print(title, ",", artist, ",", album, ",", year, ",", pista) |
|
|
|
def handle(self, *args, **options): |
|
|
|
fichero = options["fichero_csv"] |
|
|
|
with open(fichero, 'r') as file: |
|
|
|
reader = csv.DictReader(file) |
|
|
|
for row in reader: |
|
|
|
title = row['title'], |
|
|
|
artist = row['artist'], |
|
|
|
album = row['album'], |
|
|
|
year = row['year'], |
|
|
|
lyrics = row['lyrics'] |
|
|
|
pista = row['pista'] |
|
|
|
print(title, ",", artist, ",", album, ",", year, ",", pista) |