Andreas Preikschat has proposed merging lp:~googol-hush/openlp/songs into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~googol-hush/openlp/songs/+merge/53059

Hello!

Hacked the song database to speed up searches and the application start. I used 
"lazy=False" so that the author objects are loaded together with the song 
objects. [1]

[1] 
http://www.sqlalchemy.org/docs/05/reference/orm/mapping.html?highlight=lazy#sqlalchemy.orm.relation

Note: This of course means, that the author objects are always loaded together 
with the song!

-- 
https://code.launchpad.net/~googol-hush/openlp/songs/+merge/53059
Your team OpenLP Core is requested to review the proposed merge of 
lp:~googol-hush/openlp/songs into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/db.py'
--- openlp/plugins/songs/lib/db.py	2011-02-24 05:47:38 +0000
+++ openlp/plugins/songs/lib/db.py	2011-03-11 18:09:16 +0000
@@ -256,7 +256,7 @@
     mapper(Song, songs_table,
         properties={
             'authors': relation(Author, backref='songs',
-                secondary=authors_songs_table),
+                secondary=authors_songs_table, lazy=False),
             'book': relation(Book, backref='songs'),
             'media_files': relation(MediaFile, backref='songs',
                 secondary=media_files_songs_table),

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2011-03-09 18:43:50 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2011-03-11 18:09:16 +0000
@@ -253,9 +253,9 @@
         if self.searchAsYouType:
             search_length = 1
             if self.searchTextEdit.currentSearchType() == SongSearch.Entire:
-                search_length = 7
+                search_length = 4
             elif self.searchTextEdit.currentSearchType() == SongSearch.Lyrics:
-                search_length = 6
+                search_length = 3
             if len(text) > search_length:
                 self.onSearchTextButtonClick()
             elif len(text) == 0:

_______________________________________________
Mailing list: https://launchpad.net/~openlp-core
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to