Block song exports

This commit is contained in:
Tim Bentley 2011-12-04 16:36:18 +00:00
parent f751ae092a
commit 17bca693c6
2 changed files with 7 additions and 1 deletions

View File

@ -358,7 +358,10 @@ class Manager(object):
def delete_all_objects(self, object_class, filter_clause=None): def delete_all_objects(self, object_class, filter_clause=None):
""" """
Delete all object records Delete all object records.
This method should only be used for simple tables and not ones with
relationships. The relationships are not deleted from the database and
this will lead to database corruptions.
``object_class`` ``object_class``
The type of object to delete The type of object to delete

View File

@ -252,6 +252,9 @@ class SongExportForm(OpenLPWizard):
songs = self.plugin.manager.get_all_objects(Song) songs = self.plugin.manager.get_all_objects(Song)
songs.sort(cmp=locale.strcoll, key=lambda song: song.title.lower()) songs.sort(cmp=locale.strcoll, key=lambda song: song.title.lower())
for song in songs: for song in songs:
# No need to export temporary songs.
if song.temporary:
continue
authors = u', '.join([author.display_name authors = u', '.join([author.display_name
for author in song.authors]) for author in song.authors])
title = u'%s (%s)' % (unicode(song.title), authors) title = u'%s (%s)' % (unicode(song.title), authors)