This commit is contained in:
Armin Köhler 2011-03-17 22:04:54 +01:00
parent a23d902fa5
commit 9a30a4ae6a
2 changed files with 4 additions and 22 deletions

View File

@ -365,7 +365,8 @@ class BibleDB(QtCore.QObject, Manager):
The name of the book to return.
"""
log.debug(u'BibleDb.get_book_by_book_ref_id("%s")', id)
db_book = self.get_object_filtered(Book, Book.book_reference_id.like(id))
db_book = self.get_object_filtered(Book,
Book.book_reference_id.like(id))
return db_book
def get_verses(self, reference_list, en_reference_list):
@ -875,26 +876,6 @@ class SpellingDB(QtCore.QObject, Manager):
else:
return id[0]
def get_book_name_by_reference_id(self, id, language):
"""
Return the name of a book by id and language.
``id``
The name to search the id.
``language``
The language for which should be searched
"""
log.debug(u'SpellingDB.get_book_name_by_reference_id("%s", "%s")', id,
language)
name = self.session.query(Spelling.name)\
.filter(Spelling.book_reference_id.like(id))\
.filter(Spelling.language_id.like(language)).first()
if not name:
return None
else:
return unicode(name[0])
def create_spelling(self, name, book_reference_id, language_id):
"""
Add a spelling to the database.

View File

@ -300,7 +300,8 @@ class BibleManager(object):
get_book_ref_id_by_name(book, language_id)
book = self.db_cache[bible].get_book_by_book_ref_id(
book_ref_id)
new_reflist.append((book.name, item[1], item[2], item[3]))
new_reflist.append((book.name, item[1], item[2],
item[3]))
reflist = new_reflist
log.debug(u'BibleManager.get_verses("reflist: %s")', reflist)
en_reflist = []