From 10d5d62d67778f590147643feb7848a490c1a5db Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Tue, 25 Jun 2024 08:28:29 +0200 Subject: [PATCH] Campo pista en canciones --- LyricsPy/servicios/instance/songs.db | Bin 69632 -> 69632 bytes LyricsPy/servicios/lyrics/models.py | 2 ++ LyricsPy/servicios/lyrics/paginas.py | 2 ++ .../servicios/lyrics/templates/add_song.html | 3 +++ .../servicios/lyrics/templates/album.html | 8 +++++--- .../servicios/lyrics/templates/index.html | 2 ++ .../servicios/lyrics/templates/search.html | 2 ++ 7 files changed, 16 insertions(+), 3 deletions(-) diff --git a/LyricsPy/servicios/instance/songs.db b/LyricsPy/servicios/instance/songs.db index 6262314353dfe462b013243158f22e1c468ea985..3d4b1651abaee4dd597d6fe59ecb22f8affc5743 100644 GIT binary patch delta 107 zcmZozz|ydQWrDPzJOcxRAP~a<^F$qEprD@pOS5C9~Z5F`Kq diff --git a/LyricsPy/servicios/lyrics/models.py b/LyricsPy/servicios/lyrics/models.py index edc40ae..0d91888 100644 --- a/LyricsPy/servicios/lyrics/models.py +++ b/LyricsPy/servicios/lyrics/models.py @@ -18,6 +18,8 @@ class Song(db.Model): author = db.Column(db.String(100), nullable=False) album_id = db.Column(db.Integer, db.ForeignKey('album.id'), nullable=False) lyrics = db.Column(db.Text, nullable=False) + pista = db.Column(db.Integer, nullable=False) # Nuevo campo + def __repr__(self): return f'' diff --git a/LyricsPy/servicios/lyrics/paginas.py b/LyricsPy/servicios/lyrics/paginas.py index 397c336..d87a14f 100644 --- a/LyricsPy/servicios/lyrics/paginas.py +++ b/LyricsPy/servicios/lyrics/paginas.py @@ -21,6 +21,8 @@ def add_song(): author = request.form['author'] album_id = request.form['album_id'] lyrics = request.form['lyrics'] + pista = request.form['pista'] + new_song = Song(title=title, author=author, album_id=album_id, lyrics=lyrics) db.session.add(new_song) diff --git a/LyricsPy/servicios/lyrics/templates/add_song.html b/LyricsPy/servicios/lyrics/templates/add_song.html index 9e1b07d..8b2e2e5 100644 --- a/LyricsPy/servicios/lyrics/templates/add_song.html +++ b/LyricsPy/servicios/lyrics/templates/add_song.html @@ -3,6 +3,9 @@ {% block content %}

Añadir nueva canción

+ + + diff --git a/LyricsPy/servicios/lyrics/templates/album.html b/LyricsPy/servicios/lyrics/templates/album.html index c49d353..46be96d 100644 --- a/LyricsPy/servicios/lyrics/templates/album.html +++ b/LyricsPy/servicios/lyrics/templates/album.html @@ -19,14 +19,16 @@ - - - + + + + {% for song in songs %} + diff --git a/LyricsPy/servicios/lyrics/templates/index.html b/LyricsPy/servicios/lyrics/templates/index.html index f75a40c..3a8d43f 100644 --- a/LyricsPy/servicios/lyrics/templates/index.html +++ b/LyricsPy/servicios/lyrics/templates/index.html @@ -12,6 +12,7 @@
TitleAuthorAlbumPistaTítuloAutorÁlbum
{{ song.pista }} {{ song.title }} {{ song.author }} {{ song.album.name }}
+ @@ -20,6 +21,7 @@ {% for song in songs %} + diff --git a/LyricsPy/servicios/lyrics/templates/search.html b/LyricsPy/servicios/lyrics/templates/search.html index 028f03a..abb67c4 100644 --- a/LyricsPy/servicios/lyrics/templates/search.html +++ b/LyricsPy/servicios/lyrics/templates/search.html @@ -7,6 +7,7 @@
Pista Título Autor Álbum
{{ song.pista }} {{ song.title }} {{ song.author }} {{ song.album.name }}
+ @@ -15,6 +16,7 @@ {% for song in songs %} +
Pista Título Autor Álbum
{{ song.pista }} {{ song.title }} {{ song.author }} {{ song.album.name }}