Fix deleting song books

Fixes: https://launchpad.net/bugs/1600510
This commit is contained in:
Phill 2019-07-30 20:52:10 +01:00
parent 603a6ff7d6
commit 5fb9eb70af

View File

@ -374,7 +374,9 @@ def init_schema(url):
mapper(SongBookEntry, songs_songbooks_table, properties={ mapper(SongBookEntry, songs_songbooks_table, properties={
'songbook': relation(Book) 'songbook': relation(Book)
}) })
mapper(Book, song_books_table) mapper(Book, song_books_table, properties={
'songs': relation(Song, secondary=songs_songbooks_table)
})
mapper(MediaFile, media_files_table) mapper(MediaFile, media_files_table)
mapper(Song, songs_table, properties={ mapper(Song, songs_table, properties={
# Use the authors_songs relation when you need access to the 'author_type' attribute # Use the authors_songs relation when you need access to the 'author_type' attribute