forked from openlp/openlp
Head
This commit is contained in:
commit
0b35701e30
@ -177,10 +177,7 @@ class BibleDB(QtCore.QObject, Manager):
|
|||||||
Returns the version name of the Bible.
|
Returns the version name of the Bible.
|
||||||
"""
|
"""
|
||||||
version_name = self.get_object(BibleMeta, u'Version')
|
version_name = self.get_object(BibleMeta, u'Version')
|
||||||
if version_name:
|
self.name = version_name.value if version_name else None
|
||||||
self.name = version_name.value
|
|
||||||
else:
|
|
||||||
self.name = None
|
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def clean_filename(self, old_filename):
|
def clean_filename(self, old_filename):
|
||||||
@ -383,15 +380,13 @@ class BibleDB(QtCore.QObject, Manager):
|
|||||||
log.debug(u'BibleDB.verse_search("%s")', text)
|
log.debug(u'BibleDB.verse_search("%s")', text)
|
||||||
verses = self.session.query(Verse)
|
verses = self.session.query(Verse)
|
||||||
if text.find(u',') > -1:
|
if text.find(u',') > -1:
|
||||||
or_clause = []
|
keywords = \
|
||||||
keywords = [u'%%%s%%' % keyword.strip()
|
[u'%%%s%%' % keyword.strip() for keyword in text.split(u',')]
|
||||||
for keyword in text.split(u',')]
|
or_clause = [Verse.text.like(keyword) for keyword in keywords]
|
||||||
for keyword in keywords:
|
|
||||||
or_clause.append(Verse.text.like(keyword))
|
|
||||||
verses = verses.filter(or_(*or_clause))
|
verses = verses.filter(or_(*or_clause))
|
||||||
else:
|
else:
|
||||||
keywords = [u'%%%s%%' % keyword.strip()
|
keywords = \
|
||||||
for keyword in text.split(u' ')]
|
[u'%%%s%%' % keyword.strip() for keyword in text.split(u' ')]
|
||||||
for keyword in keywords:
|
for keyword in keywords:
|
||||||
verses = verses.filter(Verse.text.like(keyword))
|
verses = verses.filter(Verse.text.like(keyword))
|
||||||
verses = verses.all()
|
verses = verses.all()
|
||||||
|
Loading…
Reference in New Issue
Block a user