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()
|
settings.endGroup()
|
||||||
if upgrade_mod:
|
if upgrade_mod:
|
||||||
db_ver, up_ver = upgrade_db(self.db_url, 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:
|
if db_ver > up_ver:
|
||||||
print "hello"
|
print "hello"
|
||||||
critical_error_message_box(
|
critical_error_message_box(
|
||||||
|
@ -200,7 +200,7 @@ def init_schema(url):
|
|||||||
Column(u'create_date', types.DateTime(), default=func.now()),
|
Column(u'create_date', types.DateTime(), default=func.now()),
|
||||||
Column(u'last_modified', types.DateTime(), default=func.now(),
|
Column(u'last_modified', types.DateTime(), default=func.now(),
|
||||||
onupdate=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
|
# Definition of the "topics" table
|
||||||
|
@ -271,7 +271,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
cmp=locale.strcoll, key=lambda song: song.title.lower())
|
cmp=locale.strcoll, key=lambda song: song.title.lower())
|
||||||
for song in searchresults:
|
for song in searchresults:
|
||||||
# Do not display temporary songs
|
# Do not display temporary songs
|
||||||
if song.temporary == u'Y':
|
if song.temporary:
|
||||||
continue
|
continue
|
||||||
author_list = [author.display_name for author in song.authors]
|
author_list = [author.display_name for author in song.authors]
|
||||||
song_title = unicode(song.title)
|
song_title = unicode(song.title)
|
||||||
@ -290,7 +290,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
for author in searchresults:
|
for author in searchresults:
|
||||||
for song in author.songs:
|
for song in author.songs:
|
||||||
# Do not display temporary songs
|
# Do not display temporary songs
|
||||||
if song.temporary == u'Y':
|
if song.temporary:
|
||||||
continue
|
continue
|
||||||
song_detail = u'%s (%s)' % (author.display_name, song.title)
|
song_detail = u'%s (%s)' % (author.display_name, song.title)
|
||||||
song_name = QtGui.QListWidgetItem(song_detail)
|
song_name = QtGui.QListWidgetItem(song_detail)
|
||||||
|
@ -94,6 +94,6 @@ def upgrade_3(session, metadata, tables):
|
|||||||
|
|
||||||
This upgrade adds a temporary song flag to the songs table
|
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'])
|
.create(table=tables[u'songs'])
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ class OpenLyrics(object):
|
|||||||
song.verse_order = u''
|
song.verse_order = u''
|
||||||
song.search_title = u''
|
song.search_title = u''
|
||||||
if parse_and_not_save:
|
if parse_and_not_save:
|
||||||
song.temporary = u'Y'
|
song.temporary = True
|
||||||
self._process_copyright(properties, song)
|
self._process_copyright(properties, song)
|
||||||
self._process_cclinumber(properties, song)
|
self._process_cclinumber(properties, song)
|
||||||
self._process_titles(properties, song)
|
self._process_titles(properties, song)
|
||||||
|
@ -265,7 +265,7 @@ class SongsPlugin(Plugin):
|
|||||||
"""
|
"""
|
||||||
log.info(u'Songs Finalising')
|
log.info(u'Songs Finalising')
|
||||||
# Remove temporary songs
|
# 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
|
# Clean up files and connections
|
||||||
self.manager.finalise()
|
self.manager.finalise()
|
||||||
self.songImportItem.setVisible(False)
|
self.songImportItem.setVisible(False)
|
||||||
|
Loading…
Reference in New Issue
Block a user