2009-07-14 19:44:15 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
2009-07-13 20:08:43 +00:00
|
|
|
|
2009-09-08 19:58:05 +00:00
|
|
|
###############################################################################
|
|
|
|
# OpenLP - Open Source Lyrics Projection #
|
|
|
|
# --------------------------------------------------------------------------- #
|
2010-01-11 15:07:53 +00:00
|
|
|
# Copyright (c) 2008-2010 Raoul Snyman #
|
|
|
|
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
|
2010-03-21 23:58:01 +00:00
|
|
|
# Gorven, Scott Guerrieri, Christian Richter, Maikel Stuivenberg, Martin #
|
|
|
|
# Thompson, Jon Tibble, Carsten Tinggaard #
|
2009-09-08 19:58:05 +00:00
|
|
|
# --------------------------------------------------------------------------- #
|
|
|
|
# This program is free software; you can redistribute it and/or modify it #
|
|
|
|
# under the terms of the GNU General Public License as published by the Free #
|
|
|
|
# Software Foundation; version 2 of the License. #
|
|
|
|
# #
|
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
|
|
|
# more details. #
|
|
|
|
# #
|
|
|
|
# You should have received a copy of the GNU General Public License along #
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
|
|
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
|
|
|
###############################################################################
|
2009-07-13 20:08:43 +00:00
|
|
|
|
2008-10-30 20:44:54 +00:00
|
|
|
import logging
|
2010-01-17 16:48:45 +00:00
|
|
|
import chardet
|
2010-03-15 18:47:07 +00:00
|
|
|
import re
|
2008-10-30 20:44:54 +00:00
|
|
|
|
2010-06-16 01:48:52 +00:00
|
|
|
from PyQt4 import QtCore, QtGui
|
2010-06-15 00:44:06 +00:00
|
|
|
from sqlalchemy import Column, ForeignKey, or_, Table, types
|
|
|
|
from sqlalchemy.orm import class_mapper, mapper, relation
|
|
|
|
from sqlalchemy.orm.exc import UnmappedClassError
|
2009-12-30 17:29:08 +00:00
|
|
|
|
2010-06-22 15:09:49 +00:00
|
|
|
from openlp.core.lib import translate
|
|
|
|
from openlp.core.lib.db import BaseModel, init_db, Manager
|
2008-12-07 20:04:07 +00:00
|
|
|
|
2009-12-27 23:54:00 +00:00
|
|
|
log = logging.getLogger(__name__)
|
2009-05-01 22:26:43 +00:00
|
|
|
|
2010-06-15 00:44:06 +00:00
|
|
|
class BibleMeta(BaseModel):
|
|
|
|
"""
|
|
|
|
Bible Meta Data
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
class Testament(BaseModel):
|
|
|
|
"""
|
|
|
|
Bible Testaments
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
class Book(BaseModel):
|
|
|
|
"""
|
|
|
|
Song model
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
class Verse(BaseModel):
|
|
|
|
"""
|
|
|
|
Topic model
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
def init_schema(url):
|
|
|
|
"""
|
|
|
|
Setup a bible database connection and initialise the database schema
|
|
|
|
|
|
|
|
``url``
|
|
|
|
The database to setup
|
|
|
|
"""
|
|
|
|
session, metadata = init_db(url)
|
|
|
|
|
|
|
|
meta_table = Table(u'metadata', metadata,
|
|
|
|
Column(u'key', types.Unicode(255), primary_key=True, index=True),
|
|
|
|
Column(u'value', types.Unicode(255)),
|
|
|
|
)
|
|
|
|
testament_table = Table(u'testament', metadata,
|
|
|
|
Column(u'id', types.Integer, primary_key=True),
|
|
|
|
Column(u'name', types.Unicode(50)),
|
|
|
|
)
|
|
|
|
book_table = Table(u'book', metadata,
|
|
|
|
Column(u'id', types.Integer, primary_key=True),
|
|
|
|
Column(u'testament_id', types.Integer, ForeignKey(u'testament.id')),
|
|
|
|
Column(u'name', types.Unicode(50), index=True),
|
|
|
|
Column(u'abbreviation', types.Unicode(5), index=True),
|
|
|
|
)
|
|
|
|
verse_table = Table(u'verse', metadata,
|
|
|
|
Column(u'id', types.Integer, primary_key=True, index=True),
|
|
|
|
Column(u'book_id', types.Integer, ForeignKey(u'book.id'), index=True),
|
|
|
|
Column(u'chapter', types.Integer, index=True),
|
|
|
|
Column(u'verse', types.Integer, index=True),
|
|
|
|
Column(u'text', types.UnicodeText, index=True),
|
|
|
|
)
|
|
|
|
|
|
|
|
try:
|
|
|
|
class_mapper(BibleMeta)
|
|
|
|
except UnmappedClassError:
|
|
|
|
mapper(BibleMeta, meta_table)
|
|
|
|
try:
|
|
|
|
class_mapper(Testament)
|
|
|
|
except UnmappedClassError:
|
|
|
|
mapper(Testament, testament_table,
|
|
|
|
properties={'books': relation(Book, backref='testament')})
|
|
|
|
try:
|
|
|
|
class_mapper(Book)
|
|
|
|
except UnmappedClassError:
|
|
|
|
mapper(Book, book_table,
|
|
|
|
properties={'verses': relation(Verse, backref='book')})
|
|
|
|
try:
|
|
|
|
class_mapper(Verse)
|
|
|
|
except UnmappedClassError:
|
|
|
|
mapper(Verse, verse_table)
|
|
|
|
|
|
|
|
metadata.create_all(checkfirst=True)
|
|
|
|
return session
|
|
|
|
|
|
|
|
|
|
|
|
class BibleDB(QtCore.QObject, Manager):
|
2009-12-27 23:54:00 +00:00
|
|
|
"""
|
|
|
|
This class represents a database-bound Bible. It is used as a base class
|
|
|
|
for all the custom importers, so that the can implement their own import
|
|
|
|
methods, but benefit from the database methods in here via inheritance,
|
|
|
|
rather than depending on yet another object.
|
|
|
|
"""
|
|
|
|
|
2010-01-31 19:49:01 +00:00
|
|
|
def __init__(self, parent, **kwargs):
|
2009-12-30 17:29:08 +00:00
|
|
|
"""
|
|
|
|
The constructor loads up the database and creates and initialises the
|
|
|
|
tables if the database doesn't exist.
|
|
|
|
|
|
|
|
**Required keyword arguments:**
|
|
|
|
|
|
|
|
``path``
|
|
|
|
The path to the bible database file.
|
|
|
|
|
|
|
|
``name``
|
|
|
|
The name of the database. This is also used as the file name for
|
|
|
|
SQLite databases.
|
|
|
|
"""
|
2010-02-27 09:18:26 +00:00
|
|
|
log.info(u'BibleDB loaded')
|
2010-01-31 19:49:01 +00:00
|
|
|
QtCore.QObject.__init__(self)
|
2010-06-14 02:42:47 +00:00
|
|
|
self.bible_plugin = parent
|
2009-12-30 17:29:08 +00:00
|
|
|
if u'path' not in kwargs:
|
2009-12-27 23:54:00 +00:00
|
|
|
raise KeyError(u'Missing keyword argument "path".')
|
2010-03-16 19:46:19 +00:00
|
|
|
if u'name' not in kwargs and u'file' not in kwargs:
|
|
|
|
raise KeyError(u'Missing keyword argument "name" or "file".')
|
2010-02-06 15:33:23 +00:00
|
|
|
self.stop_import_flag = False
|
2010-03-16 19:46:19 +00:00
|
|
|
if u'name' in kwargs:
|
|
|
|
self.name = kwargs[u'name']
|
|
|
|
if not isinstance(self.name, unicode):
|
|
|
|
self.name = unicode(self.name, u'utf-8')
|
|
|
|
self.file = self.clean_filename(self.name)
|
|
|
|
if u'file' in kwargs:
|
|
|
|
self.file = kwargs[u'file']
|
2010-06-15 00:44:06 +00:00
|
|
|
Manager.__init__(self, u'bibles', init_schema, self.file)
|
2010-03-16 19:46:19 +00:00
|
|
|
if u'file' in kwargs:
|
|
|
|
self.get_name()
|
2010-06-18 01:26:01 +00:00
|
|
|
self.wizard = None
|
2010-03-16 19:46:19 +00:00
|
|
|
|
2010-06-10 13:28:41 +00:00
|
|
|
def stop_import(self):
|
|
|
|
"""
|
|
|
|
Stops the import of the Bible.
|
|
|
|
"""
|
|
|
|
log.debug('Stopping import')
|
|
|
|
self.stop_import_flag = True
|
|
|
|
|
2010-03-16 19:46:19 +00:00
|
|
|
def get_name(self):
|
2010-03-27 12:37:21 +00:00
|
|
|
"""
|
|
|
|
Returns the version name of the Bible.
|
|
|
|
"""
|
2010-06-15 00:44:06 +00:00
|
|
|
version_name = self.get_object(BibleMeta, u'Version')
|
2010-03-16 19:46:19 +00:00
|
|
|
if version_name:
|
|
|
|
self.name = version_name.value
|
|
|
|
else:
|
|
|
|
self.name = None
|
|
|
|
return self.name
|
2009-05-01 22:26:43 +00:00
|
|
|
|
2010-03-15 18:47:07 +00:00
|
|
|
def clean_filename(self, old_filename):
|
2010-03-27 12:37:21 +00:00
|
|
|
"""
|
|
|
|
Clean up the version name of the Bible and convert it into a valid
|
|
|
|
file name.
|
|
|
|
|
|
|
|
``old_filename``
|
|
|
|
The "dirty" file name or version name.
|
|
|
|
"""
|
2010-04-30 21:00:17 +00:00
|
|
|
if not isinstance(old_filename, unicode):
|
2010-03-16 19:46:19 +00:00
|
|
|
old_filename = unicode(old_filename, u'utf-8')
|
2010-03-16 20:43:41 +00:00
|
|
|
old_filename = re.sub(r'[^\w]+', u'_', old_filename).strip(u'_')
|
2010-03-16 19:46:19 +00:00
|
|
|
return old_filename + u'.sqlite'
|
2010-03-15 18:47:07 +00:00
|
|
|
|
2010-01-17 16:48:45 +00:00
|
|
|
def register(self, wizard):
|
2009-12-30 17:29:08 +00:00
|
|
|
"""
|
|
|
|
This method basically just initialialises the database. It is called
|
|
|
|
from the Bible Manager when a Bible is imported. Descendant classes
|
2010-03-27 12:37:21 +00:00
|
|
|
may want to override this method to supply their own custom
|
2009-12-30 17:29:08 +00:00
|
|
|
initialisation as well.
|
2010-03-27 12:37:21 +00:00
|
|
|
|
|
|
|
``wizard``
|
|
|
|
The actual Qt wizard form.
|
2009-12-30 17:29:08 +00:00
|
|
|
"""
|
2010-01-17 16:48:45 +00:00
|
|
|
self.wizard = wizard
|
|
|
|
self.create_meta(u'dbversion', u'2')
|
2010-06-28 13:38:29 +00:00
|
|
|
self.save_object(Testament.populate(name=u'Old Testament'))
|
|
|
|
self.save_object(Testament.populate(name=u'New Testament'))
|
|
|
|
self.save_object(Testament.populate(name=u'Apocrypha'))
|
2010-06-15 15:42:52 +00:00
|
|
|
return self.name
|
2008-10-30 20:44:54 +00:00
|
|
|
|
2009-12-30 17:29:08 +00:00
|
|
|
def create_book(self, name, abbrev, testament=1):
|
2010-03-27 12:37:21 +00:00
|
|
|
"""
|
|
|
|
Add a book to the database.
|
|
|
|
|
|
|
|
``name``
|
|
|
|
The name of the book.
|
|
|
|
|
|
|
|
``abbrev``
|
|
|
|
The abbreviation of the book.
|
|
|
|
|
|
|
|
``testament``
|
|
|
|
*Defaults to 1.* The id of the testament this book belongs to.
|
|
|
|
"""
|
2010-01-17 16:48:45 +00:00
|
|
|
log.debug(u'create_book %s,%s', name, abbrev)
|
2009-12-30 17:29:08 +00:00
|
|
|
book = Book.populate(name=name, abbreviation=abbrev,
|
|
|
|
testament_id=testament)
|
2010-06-28 13:38:29 +00:00
|
|
|
self.save_object(book)
|
2009-12-30 17:29:08 +00:00
|
|
|
return book
|
|
|
|
|
|
|
|
def create_chapter(self, book_id, chapter, textlist):
|
2010-03-27 12:37:21 +00:00
|
|
|
"""
|
|
|
|
Add a chapter and it's verses to a book.
|
|
|
|
|
|
|
|
``book_id``
|
|
|
|
The id of the book being appended.
|
|
|
|
|
|
|
|
``chapter``
|
|
|
|
The chapter number.
|
|
|
|
|
|
|
|
``textlist``
|
|
|
|
A dict of the verses to be inserted. The key is the verse number,
|
|
|
|
and the value is the verse text.
|
|
|
|
"""
|
2010-01-24 07:08:14 +00:00
|
|
|
log.debug(u'create_chapter %s,%s', book_id, chapter)
|
2009-12-30 17:29:08 +00:00
|
|
|
#text list has book and chapter as first two elements of the array
|
2009-07-14 19:44:15 +00:00
|
|
|
for verse_number, verse_text in textlist.iteritems():
|
2009-12-30 17:29:08 +00:00
|
|
|
verse = Verse.populate(
|
|
|
|
book_id = book_id,
|
2010-01-24 07:08:14 +00:00
|
|
|
chapter = chapter,
|
2009-12-30 17:29:08 +00:00
|
|
|
verse = verse_number,
|
|
|
|
text = verse_text
|
|
|
|
)
|
2009-07-14 19:44:15 +00:00
|
|
|
self.session.add(verse)
|
2010-06-15 00:44:06 +00:00
|
|
|
self.session.commit()
|
2009-05-01 22:26:43 +00:00
|
|
|
|
2009-12-30 17:29:08 +00:00
|
|
|
def create_verse(self, book_id, chapter, verse, text):
|
2010-03-27 12:37:21 +00:00
|
|
|
"""
|
|
|
|
Add a single verse to a chapter.
|
|
|
|
|
|
|
|
``book_id``
|
|
|
|
The id of the book being appended.
|
|
|
|
|
|
|
|
``chapter``
|
|
|
|
The chapter number.
|
|
|
|
|
|
|
|
``verse``
|
|
|
|
The verse number.
|
|
|
|
|
|
|
|
``text``
|
|
|
|
The verse text.
|
|
|
|
"""
|
2010-01-17 16:48:45 +00:00
|
|
|
if not isinstance(text, unicode):
|
|
|
|
details = chardet.detect(text)
|
|
|
|
text = unicode(text, details[u'encoding'])
|
2009-12-30 17:29:08 +00:00
|
|
|
verse = Verse.populate(
|
|
|
|
book_id=book_id,
|
|
|
|
chapter=chapter,
|
|
|
|
verse=verse,
|
|
|
|
text=text
|
|
|
|
)
|
|
|
|
self.session.add(verse)
|
|
|
|
return verse
|
2009-05-01 22:26:43 +00:00
|
|
|
|
2009-12-30 17:29:08 +00:00
|
|
|
def create_meta(self, key, value):
|
2010-06-15 15:42:52 +00:00
|
|
|
"""
|
|
|
|
Utility method to save BibleMeta objects in a Bible database
|
|
|
|
|
|
|
|
``key``
|
|
|
|
The key for this instance
|
|
|
|
|
|
|
|
``value``
|
|
|
|
The value for this instance
|
|
|
|
"""
|
2009-06-16 18:21:24 +00:00
|
|
|
log.debug(u'save_meta %s/%s', key, value)
|
2010-06-28 13:38:29 +00:00
|
|
|
self.save_object(BibleMeta.populate(key=key, value=value))
|
2008-11-01 11:33:02 +00:00
|
|
|
|
2009-12-30 17:29:08 +00:00
|
|
|
def get_book(self, book):
|
2010-06-15 15:42:52 +00:00
|
|
|
"""
|
|
|
|
Return a book object from the database
|
|
|
|
|
|
|
|
``book``
|
|
|
|
The name of the book to return
|
|
|
|
"""
|
2010-02-04 19:34:12 +00:00
|
|
|
log.debug(u'BibleDb.get_book("%s")', book)
|
2010-06-30 22:05:51 +00:00
|
|
|
db_book = self.get_object_filtered(Book, Book.name.like(book + u'%'))
|
2009-12-30 17:29:08 +00:00
|
|
|
if db_book is None:
|
2010-06-30 22:05:51 +00:00
|
|
|
db_book = self.get_object_filtered(Book,
|
|
|
|
Book.abbreviation.like(book + u'%'))
|
2009-12-30 17:29:08 +00:00
|
|
|
return db_book
|
2008-11-06 18:49:36 +00:00
|
|
|
|
2009-12-30 17:29:08 +00:00
|
|
|
def get_verses(self, reference_list):
|
|
|
|
"""
|
|
|
|
This is probably the most used function. It retrieves the list of
|
|
|
|
verses based on the user's query.
|
|
|
|
|
|
|
|
``reference_list``
|
|
|
|
This is the list of references the media manager item wants. It is
|
|
|
|
a list of tuples, with the following format::
|
|
|
|
|
|
|
|
(book, chapter, start_verse, end_verse)
|
|
|
|
|
|
|
|
Therefore, when you are looking for multiple items, simply break
|
|
|
|
them up into references like this, bundle them into a list. This
|
|
|
|
function then runs through the list, and returns an amalgamated
|
|
|
|
list of ``Verse`` objects. For example::
|
|
|
|
|
|
|
|
[(u'Genesis', 1, 1, 1), (u'Genesis', 2, 2, 3)]
|
|
|
|
"""
|
2010-01-31 20:36:54 +00:00
|
|
|
log.debug(u'BibleDB.get_verses: %s', reference_list)
|
2009-12-30 17:29:08 +00:00
|
|
|
verse_list = []
|
|
|
|
for book, chapter, start_verse, end_verse in reference_list:
|
|
|
|
db_book = self.get_book(book)
|
|
|
|
if end_verse == -1:
|
2010-02-06 10:22:20 +00:00
|
|
|
end_verse = self.get_verse_count(book, chapter)
|
2009-12-30 17:29:08 +00:00
|
|
|
if db_book:
|
2010-01-24 07:08:14 +00:00
|
|
|
book = db_book.name
|
2010-02-04 19:34:12 +00:00
|
|
|
log.debug(u'Book name corrected to "%s"', book)
|
2010-06-16 01:48:52 +00:00
|
|
|
verses = self.session.query(Verse)\
|
|
|
|
.filter_by(book_id=db_book.id)\
|
|
|
|
.filter_by(chapter=chapter)\
|
|
|
|
.filter(Verse.verse >= start_verse)\
|
|
|
|
.filter(Verse.verse <= end_verse)\
|
|
|
|
.order_by(Verse.verse)\
|
|
|
|
.all()
|
|
|
|
verse_list.extend(verses)
|
|
|
|
else:
|
|
|
|
log.debug(u'OpenLP failed to find book %s', book)
|
2010-07-08 12:38:48 +00:00
|
|
|
QtGui.QMessageBox.information(self.bible_plugin.mediaItem,
|
2010-06-21 16:43:59 +00:00
|
|
|
translate('BibleDB', 'Book not found'),
|
2010-06-21 18:28:36 +00:00
|
|
|
translate('BibleDB', u'The book you requested could not '
|
|
|
|
'be found in this bible. Please check your spelling '
|
|
|
|
'and that this is a complete bible not just one '
|
|
|
|
'testament.'))
|
2009-12-30 17:29:08 +00:00
|
|
|
return verse_list
|
|
|
|
|
|
|
|
def verse_search(self, text):
|
|
|
|
"""
|
|
|
|
Search for verses containing text ``text``.
|
|
|
|
|
|
|
|
``text``
|
|
|
|
The text to search for. If the text contains commas, it will be
|
|
|
|
split apart and OR'd on the list of values. If the text just
|
|
|
|
contains spaces, it will split apart and AND'd on the list of
|
|
|
|
values.
|
|
|
|
"""
|
2010-01-31 20:36:54 +00:00
|
|
|
log.debug(u'BibleDB.verse_search("%s")', text)
|
2009-12-30 17:29:08 +00:00
|
|
|
verses = self.session.query(Verse)
|
|
|
|
if text.find(u',') > -1:
|
|
|
|
or_clause = []
|
2010-06-01 17:13:54 +00:00
|
|
|
keywords = [u'%%%s%%' % keyword.strip()
|
|
|
|
for keyword in text.split(u',')]
|
2009-12-30 17:29:08 +00:00
|
|
|
for keyword in keywords:
|
|
|
|
or_clause.append(Verse.text.like(keyword))
|
|
|
|
verses = verses.filter(or_(*or_clause))
|
|
|
|
else:
|
2010-06-01 17:13:54 +00:00
|
|
|
keywords = [u'%%%s%%' % keyword.strip()
|
|
|
|
for keyword in text.split(u' ')]
|
2009-12-30 17:29:08 +00:00
|
|
|
for keyword in keywords:
|
|
|
|
verses = verses.filter(Verse.text.like(keyword))
|
|
|
|
verses = verses.all()
|
|
|
|
return verses
|
2009-05-01 22:26:43 +00:00
|
|
|
|
2009-12-30 17:29:08 +00:00
|
|
|
def get_chapter_count(self, book):
|
2010-06-15 15:42:52 +00:00
|
|
|
"""
|
|
|
|
Return the number of chapters in a book
|
|
|
|
|
|
|
|
``book``
|
|
|
|
The book to get the chapter count for
|
|
|
|
"""
|
2010-01-31 20:36:54 +00:00
|
|
|
log.debug(u'BibleDB.get_chapter_count("%s")', book)
|
2009-12-30 17:29:08 +00:00
|
|
|
count = self.session.query(Verse.chapter).join(Book)\
|
|
|
|
.filter(Book.name==book)\
|
|
|
|
.distinct().count()
|
|
|
|
if not count:
|
2009-10-12 10:18:54 +00:00
|
|
|
return 0
|
|
|
|
else:
|
2009-12-30 17:29:08 +00:00
|
|
|
return count
|
2009-05-01 22:26:43 +00:00
|
|
|
|
2009-12-30 17:29:08 +00:00
|
|
|
def get_verse_count(self, book, chapter):
|
2010-06-15 15:42:52 +00:00
|
|
|
"""
|
|
|
|
Return the number of verses in a chapter
|
|
|
|
|
|
|
|
``book``
|
|
|
|
The book containing the chapter
|
|
|
|
|
|
|
|
``chapter``
|
|
|
|
The chapter to get the verse count for
|
|
|
|
"""
|
2010-01-31 20:36:54 +00:00
|
|
|
log.debug(u'BibleDB.get_verse_count("%s", %s)', book, chapter)
|
2009-12-30 17:29:08 +00:00
|
|
|
count = self.session.query(Verse).join(Book)\
|
|
|
|
.filter(Book.name==book)\
|
|
|
|
.filter(Verse.chapter==chapter)\
|
|
|
|
.count()
|
|
|
|
if not count:
|
2009-10-12 10:18:54 +00:00
|
|
|
return 0
|
|
|
|
else:
|
2009-12-30 17:29:08 +00:00
|
|
|
return count
|
2009-05-01 22:26:43 +00:00
|
|
|
|
2008-12-16 19:13:31 +00:00
|
|
|
def dump_bible(self):
|
2010-06-15 15:42:52 +00:00
|
|
|
"""
|
|
|
|
Utility debugging method to dump the contents of a bible
|
|
|
|
"""
|
2010-02-04 19:34:12 +00:00
|
|
|
log.debug(u'.........Dumping Bible Database')
|
|
|
|
log.debug('...............................Books ')
|
2009-07-14 19:44:15 +00:00
|
|
|
books = self.session.query(Book).all()
|
|
|
|
log.debug(books)
|
2010-02-04 19:34:12 +00:00
|
|
|
log.debug(u'...............................Verses ')
|
2009-07-14 19:44:15 +00:00
|
|
|
verses = self.session.query(Verse).all()
|
|
|
|
log.debug(verses)
|