def set_playlist(db_session, name, songs):
    c = db_session.cursor()
    c.execute("""DELETE FROM playlists WHERE name = ?""", [name])
    c.execute("""INSERT INTO playlists (name, songs) VALUES (?, ?)""", [name, str(cPickle.dumps(songs))])
    db_session.commit()
    c.close()
Saves a playilst with the given name in the database, automatically pickles list.
dataset/ETHPy150Open bahamas10/Viridian/AmpacheTools/dbfunctions.py/set_playlist