← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~raoul-snyman/openlp/bug-863845 into lp:openlp

 

Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/bug-863845 into lp:openlp.

Requested reviews:
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/bug-863845/+merge/84381

Fix problem where importing new song databases now does not work.
-- 
https://code.launchpad.net/~raoul-snyman/openlp/bug-863845/+merge/84381
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/songs/lib/olpimport.py'
--- openlp/plugins/songs/lib/olpimport.py	2011-12-02 20:17:57 +0000
+++ openlp/plugins/songs/lib/olpimport.py	2011-12-03 18:39:29 +0000
@@ -39,7 +39,7 @@
 from openlp.core.lib.db import BaseModel
 from openlp.core.ui.wizard import WizardStrings
 from openlp.plugins.songs.lib import clean_song
-from openlp.plugins.songs.lib.db import Author, Book, MediaFile, Song, Topic
+from openlp.plugins.songs.lib.db import Author, Book, Song, Topic, MediaFile
 from songimport import SongImport
 
 log = logging.getLogger(__name__)
@@ -143,7 +143,8 @@
                     secondary=source_media_files_songs_table)
             else:
                 song_props['media_files'] = relation(OldMediaFile,
-                    backref='songs')
+                    backref='songs', primaryjoin=source_songs_table.c.id==OldMediaFile.song_id,
+                    foreign_keys=[source_media_files_table.c.song_id])
         try:
             class_mapper(OldAuthor)
         except UnmappedClassError:


Follow ups