Add entry deletion, footer

This commit is contained in:
2019-05-22 12:19:28 +02:00
parent 0f7144dbc9
commit 5818eb1150
5 changed files with 126 additions and 9 deletions

View File

@@ -28,7 +28,7 @@ def create_entry_table():
def create_list_view():
conn = open_db()
conn.execute("""CREATE VIEW IF NOT EXISTS [Liste] AS
SELECT Name, Title, Artist
SELECT Name, Title, Artist, entries.Id
FROM entries, songs
WHERE entries.Song_Id=songs.Id""")
conn.close()
@@ -59,3 +59,11 @@ def add_entry(name,song_id):
conn.commit()
conn.close()
return
def delete_entry(id):
conn = open_db()
cur = conn.cursor()
cur.execute("DELETE FROM entries WHERE id=?",(id,))
conn.commit()
conn.close()
return True