forked from openlp/openlp
Change Data type
This commit is contained in:
parent
add75e9c7f
commit
6698ce578d
@ -202,7 +202,6 @@ class Manager(object):
|
||||
settings.endGroup()
|
||||
if upgrade_mod:
|
||||
db_ver, up_ver = upgrade_db(self.db_url, upgrade_mod)
|
||||
print db_ver, up_ver, db_ver > up_ver
|
||||
if db_ver > up_ver:
|
||||
print "hello"
|
||||
critical_error_message_box(
|
||||
|
@ -200,7 +200,7 @@ def init_schema(url):
|
||||
Column(u'create_date', types.DateTime(), default=func.now()),
|
||||
Column(u'last_modified', types.DateTime(), default=func.now(),
|
||||
onupdate=func.now()),
|
||||
Column(u'temporary', types.Unicode(1), default=u'N')
|
||||
Column(u'temporary', types.Boolean(), default=False)
|
||||
)
|
||||
|
||||
# Definition of the "topics" table
|
||||
|
@ -271,7 +271,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
cmp=locale.strcoll, key=lambda song: song.title.lower())
|
||||
for song in searchresults:
|
||||
# Do not display temporary songs
|
||||
if song.temporary == u'Y':
|
||||
if song.temporary:
|
||||
continue
|
||||
author_list = [author.display_name for author in song.authors]
|
||||
song_title = unicode(song.title)
|
||||
@ -290,7 +290,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
for author in searchresults:
|
||||
for song in author.songs:
|
||||
# Do not display temporary songs
|
||||
if song.temporary == u'Y':
|
||||
if song.temporary:
|
||||
continue
|
||||
song_detail = u'%s (%s)' % (author.display_name, song.title)
|
||||
song_name = QtGui.QListWidgetItem(song_detail)
|
||||
|
@ -87,13 +87,13 @@ def upgrade_2(session, metadata, tables):
|
||||
.create(table=tables[u'songs'])
|
||||
Column(u'last_modified', types.DateTime(), default=func.now())\
|
||||
.create(table=tables[u'songs'])
|
||||
|
||||
|
||||
def upgrade_3(session, metadata, tables):
|
||||
"""
|
||||
Version 3 upgrade.
|
||||
|
||||
This upgrade adds a temporary song flag to the songs table
|
||||
"""
|
||||
Column(u'temporary', types.Unicode(1), default=u'N')\
|
||||
Column(u'temporary', types.Boolean(), default=False)\
|
||||
.create(table=tables[u'songs'])
|
||||
|
||||
|
@ -378,7 +378,7 @@ class OpenLyrics(object):
|
||||
song.verse_order = u''
|
||||
song.search_title = u''
|
||||
if parse_and_not_save:
|
||||
song.temporary = u'Y'
|
||||
song.temporary = True
|
||||
self._process_copyright(properties, song)
|
||||
self._process_cclinumber(properties, song)
|
||||
self._process_titles(properties, song)
|
||||
|
@ -265,7 +265,7 @@ class SongsPlugin(Plugin):
|
||||
"""
|
||||
log.info(u'Songs Finalising')
|
||||
# Remove temporary songs
|
||||
self.manager.delete_all_objects(Song, Song.temporary == u'Y')
|
||||
self.manager.delete_all_objects(Song, Song.temporary == True)
|
||||
# Clean up files and connections
|
||||
self.manager.finalise()
|
||||
self.songImportItem.setVisible(False)
|
||||
|
Loading…
Reference in New Issue
Block a user