2004-09-29 08:49:01 +05:30
|
|
|
#
|
2004-08-01 09:51:31 +05:30
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
2007-02-20 06:09:10 +05:30
|
|
|
# Copyright (C) 2000-2007 Donald N. Allingham
|
2004-08-01 09:51:31 +05:30
|
|
|
#
|
|
|
|
# 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; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
2006-04-08 02:36:20 +05:30
|
|
|
# This program is distributed in the hope that it will be useful,
|
2004-08-01 09:51:31 +05:30
|
|
|
# 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
|
|
|
|
#
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
|
|
|
Base class for the GRAMPS databases. All database interfaces should inherit
|
|
|
|
from this class.
|
|
|
|
"""
|
2009-06-12 21:47:07 +05:30
|
|
|
from __future__ import with_statement
|
2004-08-07 10:46:57 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# libraries
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2004-08-01 09:51:31 +05:30
|
|
|
import cPickle
|
2004-08-24 09:18:15 +05:30
|
|
|
import time
|
2005-01-09 07:48:49 +05:30
|
|
|
import random
|
2004-08-27 03:24:14 +05:30
|
|
|
import locale
|
2006-04-08 02:36:20 +05:30
|
|
|
import os
|
2005-04-19 20:17:02 +05:30
|
|
|
from sys import maxint
|
2006-05-07 10:52:44 +05:30
|
|
|
from bsddb import db
|
2006-04-07 03:32:46 +05:30
|
|
|
from gettext import gettext as _
|
2006-04-08 02:36:20 +05:30
|
|
|
|
2005-01-09 07:48:49 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GRAMPS libraries
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2008-02-19 01:37:09 +05:30
|
|
|
from gen.lib import (MediaObject, Person, Family, Source, Event, Place,
|
|
|
|
Repository, Note, GenderStats, Researcher)
|
2008-02-21 10:28:56 +05:30
|
|
|
from gen.utils.callback import Callback
|
2008-02-23 14:08:55 +05:30
|
|
|
from gen.db.iterator import CursorIterator
|
2009-09-01 00:12:29 +05:30
|
|
|
class GrampsDbBase(object):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
|
|
|
GRAMPS database object. This object is a base class for all
|
2009-09-01 00:12:29 +05:30
|
|
|
database interfaces. All methods raise NotImplementedError
|
|
|
|
and must be implemented in the derived class as required.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2004-08-01 09:51:31 +05:30
|
|
|
|
|
|
|
def __init__(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Create a new GrampsDbBase instance.
|
|
|
|
|
|
|
|
A new GrampDbBase class should never be directly created. Only classes
|
|
|
|
derived from this class should be created.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
|
|
|
|
2009-09-01 00:12:29 +05:30
|
|
|
super(GrampsDbBase, self).__init__()
|
2005-03-31 10:00:44 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def set_prefixes(self, person, media, family, source, place, event,
|
|
|
|
repository, note):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Set the prefixes for the gramps ids for all gramps objects
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2007-02-04 06:48:17 +05:30
|
|
|
|
2006-12-01 21:56:34 +05:30
|
|
|
def rebuild_secondary(self, callback):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Rebuild secondary indices
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2005-06-05 09:31:56 +05:30
|
|
|
def version_supported(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return True when the file has a supported version."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-06-05 09:31:56 +05:30
|
|
|
|
2005-03-03 11:03:22 +05:30
|
|
|
def need_upgrade(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return True if database needs to be upgraded
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2005-03-03 11:03:22 +05:30
|
|
|
|
2005-12-15 11:49:37 +05:30
|
|
|
def gramps_upgrade(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return True if database is upgraded
|
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
raise NotImplementedError
|
2006-01-07 02:25:49 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def set_auto_remove(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
BSDDB change log settings using new method with renamed attributes
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
raise NotImplementedError
|
2006-01-07 02:25:49 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def write_version(self, name):
|
|
|
|
"""Write version number for a newly created DB."""
|
|
|
|
raise NotImplementedError
|
2006-01-07 02:25:49 +05:30
|
|
|
|
2005-01-09 07:48:49 +05:30
|
|
|
def create_id(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Create an id
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2005-01-09 07:48:49 +05:30
|
|
|
|
2004-12-05 09:45:48 +05:30
|
|
|
def get_person_cursor(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return a reference to a cursor over Person objects
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2004-12-05 09:45:48 +05:30
|
|
|
|
2004-12-10 06:58:43 +05:30
|
|
|
def get_family_cursor(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return a reference to a cursor over Family objects
|
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2004-12-10 06:58:43 +05:30
|
|
|
|
2005-06-07 10:38:50 +05:30
|
|
|
def get_event_cursor(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return a reference to a cursor over Family objects
|
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2005-06-07 10:38:50 +05:30
|
|
|
|
2004-12-10 06:58:43 +05:30
|
|
|
def get_place_cursor(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return a reference to a cursor over Place objects
|
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2004-12-10 06:58:43 +05:30
|
|
|
|
|
|
|
def get_source_cursor(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return a reference to a cursor over Source objects
|
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2004-12-10 06:58:43 +05:30
|
|
|
|
|
|
|
def get_media_cursor(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return a reference to a cursor over Media objects
|
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2004-12-10 06:58:43 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def get_repository_cursor(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Return a reference to a cursor over Repository objects
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2007-02-05 02:50:46 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def get_note_cursor(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Return a reference to a cursor over Note objects
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def get_reference_map_cursor(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Returns a reference to a cursor over the reference map
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2007-02-05 02:50:46 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def get_reference_map_primary_cursor(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Returns a reference to a cursor over the reference map primary map
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def get_reference_map_referenced_cursor(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Returns a reference to a cursor over the reference map referenced map
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2006-05-07 10:52:44 +05:30
|
|
|
def open_undodb(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Open the undo database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2006-05-07 10:52:44 +05:30
|
|
|
|
|
|
|
def close_undodb(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Close the undo database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2006-05-07 10:52:44 +05:30
|
|
|
|
2009-12-21 04:14:32 +05:30
|
|
|
def load(self, name, callback, mode=None, upgrade=False):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Open the specified database.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2004-08-11 09:12:38 +05:30
|
|
|
def close(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Close the specified database.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2005-12-22 11:43:11 +05:30
|
|
|
pass
|
2004-08-11 09:12:38 +05:30
|
|
|
|
|
|
|
def is_open(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
Return True if the database has been opened.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-04-04 22:11:01 +05:30
|
|
|
|
|
|
|
def request_rebuild(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Notify clients that the data has changed significantly, and that all
|
2005-04-04 22:11:01 +05:30
|
|
|
internal data dependent on the database should be rebuilt.
|
2009-08-05 16:02:05 +05:30
|
|
|
Note that all rebuild signals on all objects are emitted at the same
|
|
|
|
time. It is correct to assume that this is always the case.
|
|
|
|
TODO: it might be better to replace these rebuild signals by one single
|
|
|
|
database-rebuild signal.
|
2005-04-04 22:11:01 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-12-15 23:02:10 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def commit_base(self, obj, data_map, key, transaction, change_time):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
Commit the specified object to the database, storing the changes as
|
2008-02-23 14:08:55 +05:30
|
|
|
part of the transaction.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-07-09 01:54:54 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def commit_person(self, person, transaction, change_time=None):
|
2005-04-18 04:04:56 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Commit the specified Person to the database, storing the changes as
|
|
|
|
part of the transaction.
|
2005-04-18 04:04:56 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-20 01:18:36 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def commit_media_object(self, obj, transaction, change_time=None):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Commit the specified MediaObject to the database, storing the changes
|
2004-08-13 10:04:07 +05:30
|
|
|
as part of the transaction.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-04-05 05:22:46 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def commit_source(self, source, transaction, change_time=None):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Commit the specified Source to the database, storing the changes as
|
|
|
|
part of the transaction.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-19 06:09:22 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def commit_place(self, place, transaction, change_time=None):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Commit the specified Place to the database, storing the changes as
|
|
|
|
part of the transaction.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-20 01:18:36 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def commit_personal_event(self, event, transaction, change_time=None):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Commit the specified personal Event to the database, storing the
|
|
|
|
changes as part of the transaction.
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def commit_family_event(self, event, transaction, change_time=None):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Commit the specified family Event to the database, storing the
|
|
|
|
changes as part of the transaction.
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def commit_event(self, event, transaction, change_time=None):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Commit the specified Event to the database, storing the changes as
|
|
|
|
part of the transaction.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-20 01:18:36 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def commit_family(self, family, transaction, change_time=None):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Commit the specified Family to the database, storing the changes as
|
|
|
|
part of the transaction.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-20 01:18:36 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def commit_repository(self, repository, transaction, change_time=None):
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Commit the specified Repository to the database, storing the changes
|
2005-05-27 23:13:04 +05:30
|
|
|
as part of the transaction.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-19 06:09:22 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def commit_note(self, note, transaction, change_time=None):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Commit the specified Note to the database, storing the changes as part
|
|
|
|
of the transaction.
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2004-08-13 10:04:07 +05:30
|
|
|
def find_next_person_gramps_id(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the next available GRAMPS' ID for a Person object based off the
|
|
|
|
person ID prefix.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2004-08-11 09:12:38 +05:30
|
|
|
def find_next_place_gramps_id(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the next available GRAMPS' ID for a Place object based off the
|
|
|
|
place ID prefix.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
|
|
|
def find_next_event_gramps_id(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the next available GRAMPS' ID for a Event object based off the
|
|
|
|
event ID prefix.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
|
|
|
def find_next_object_gramps_id(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the next available GRAMPS' ID for a MediaObject object based
|
|
|
|
off the media object ID prefix.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
|
|
|
def find_next_source_gramps_id(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the next available GRAMPS' ID for a Source object based off the
|
|
|
|
source ID prefix.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
|
|
|
def find_next_family_gramps_id(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the next available GRAMPS' ID for a Family object based off the
|
|
|
|
family ID prefix.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2005-05-27 23:13:04 +05:30
|
|
|
def find_next_repository_gramps_id(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the next available GRAMPS' ID for a Respository object based
|
2005-05-27 23:13:04 +05:30
|
|
|
off the repository ID prefix.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def find_next_note_gramps_id(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the next available GRAMPS' ID for a Note object based off the
|
|
|
|
note ID prefix.
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2007-06-26 11:32:17 +05:30
|
|
|
def get_from_handle(self, handle, class_type, data_map):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return unserialized data from database given handle and object class
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_person_from_handle(self, handle):
|
2005-04-18 04:04:56 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Person in the database from the passed gramps' ID.
|
|
|
|
|
2005-04-18 04:04:56 +05:30
|
|
|
If no such Person exists, None is returned.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_source_from_handle(self, handle):
|
2005-04-18 04:04:56 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Source in the database from the passed gramps' ID.
|
|
|
|
|
2005-04-18 04:04:56 +05:30
|
|
|
If no such Source exists, None is returned.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_object_from_handle(self, handle):
|
2005-04-18 04:04:56 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find an Object in the database from the passed gramps' ID.
|
|
|
|
|
2005-04-18 04:04:56 +05:30
|
|
|
If no such Object exists, None is returned.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_place_from_handle(self, handle):
|
2005-04-18 04:04:56 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Place in the database from the passed gramps' ID.
|
|
|
|
|
2005-04-18 04:04:56 +05:30
|
|
|
If no such Place exists, None is returned.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_event_from_handle(self, handle):
|
2005-04-18 04:04:56 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Event in the database from the passed gramps' ID.
|
|
|
|
|
2005-04-18 04:04:56 +05:30
|
|
|
If no such Event exists, None is returned.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_family_from_handle(self, handle):
|
2005-04-18 04:04:56 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Family in the database from the passed gramps' ID.
|
|
|
|
|
2005-04-18 04:04:56 +05:30
|
|
|
If no such Family exists, None is returned.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_repository_from_handle(self, handle):
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Repository in the database from the passed gramps' ID.
|
|
|
|
|
2005-05-27 23:13:04 +05:30
|
|
|
If no such Repository exists, None is returned.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def get_note_from_handle(self, handle):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Note in the database from the passed gramps' ID.
|
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
If no such Note exists, None is returned.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_person_from_gramps_id(self, val):
|
2004-08-20 07:50:06 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Person in the database from the passed GRAMPS ID.
|
|
|
|
|
2004-08-20 07:50:06 +05:30
|
|
|
If no such Person exists, None is returned.
|
2009-05-29 22:39:09 +05:30
|
|
|
Needs to be overridden by the derived class.
|
2004-08-20 07:50:06 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2004-08-20 07:50:06 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_family_from_gramps_id(self, val):
|
2004-08-20 07:50:06 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Family in the database from the passed GRAMPS ID.
|
|
|
|
|
2004-08-20 07:50:06 +05:30
|
|
|
If no such Family exists, None is returned.
|
2009-05-29 22:39:09 +05:30
|
|
|
Need to be overridden by the derived class.
|
2004-08-20 07:50:06 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2004-08-20 07:50:06 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_event_from_gramps_id(self, val):
|
2006-01-27 12:24:35 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find an Event in the database from the passed GRAMPS ID.
|
|
|
|
|
2006-01-27 12:24:35 +05:30
|
|
|
If no such Event exists, None is returned.
|
2009-05-29 22:39:09 +05:30
|
|
|
Needs to be overridden by the derived class.
|
2006-01-27 12:24:35 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2006-01-27 12:24:35 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_place_from_gramps_id(self, val):
|
2006-05-20 06:22:47 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Place in the database from the passed gramps' ID.
|
|
|
|
|
2006-05-20 06:22:47 +05:30
|
|
|
If no such Place exists, None is returned.
|
2009-05-29 22:39:09 +05:30
|
|
|
Needs to be overridden by the derived class.
|
2004-08-24 10:39:50 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2004-08-24 10:39:50 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_source_from_gramps_id(self, val):
|
2006-05-20 06:22:47 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Source in the database from the passed gramps' ID.
|
|
|
|
|
2006-05-20 06:22:47 +05:30
|
|
|
If no such Source exists, None is returned.
|
2009-05-29 22:39:09 +05:30
|
|
|
Needs to be overridden by the derived class.
|
2004-08-24 10:39:50 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2004-08-24 10:39:50 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_object_from_gramps_id(self, val):
|
2006-05-20 06:22:47 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a MediaObject in the database from the passed gramps' ID.
|
2004-08-24 10:39:50 +05:30
|
|
|
|
2008-02-23 14:08:55 +05:30
|
|
|
If no such MediaObject exists, None is returned.
|
2009-05-29 22:39:09 +05:30
|
|
|
Needs to be overridden by the derived class.
|
2004-08-24 10:39:50 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2004-08-24 10:39:50 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_repository_from_gramps_id(self, val):
|
2006-05-20 06:22:47 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Repository in the database from the passed gramps' ID.
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2008-02-23 14:08:55 +05:30
|
|
|
If no such Repository exists, None is returned.
|
2009-05-29 22:39:09 +05:30
|
|
|
Needs to be overridden by the derived class.
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
|
|
|
def get_note_from_gramps_id(self, val):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Find a Note in the database from the passed gramps' ID.
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2008-02-23 14:08:55 +05:30
|
|
|
If no such Note exists, None is returned.
|
2009-05-29 22:39:09 +05:30
|
|
|
Needs to be overridden by the derived classderri.
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2007-10-10 01:32:02 +05:30
|
|
|
def add_person(self, person, transaction, set_gid=True):
|
2005-07-09 01:54:54 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Add a Person to the database, assigning internal IDs if they have
|
2005-07-09 01:54:54 +05:30
|
|
|
not already been defined.
|
2008-02-23 14:08:55 +05:30
|
|
|
|
|
|
|
If not set_gid, then gramps_id is not set.
|
2005-07-09 01:54:54 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-07-09 01:54:54 +05:30
|
|
|
|
2007-10-10 01:32:02 +05:30
|
|
|
def add_family(self, family, transaction, set_gid=True):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Add a Family to the database, assigning internal IDs if they have
|
2004-08-13 10:04:07 +05:30
|
|
|
not already been defined.
|
2008-02-23 14:08:55 +05:30
|
|
|
|
|
|
|
If not set_gid, then gramps_id is not set.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2007-10-10 01:32:02 +05:30
|
|
|
def add_source(self, source, transaction, set_gid=True):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Add a Source to the database, assigning internal IDs if they have
|
2004-08-13 10:04:07 +05:30
|
|
|
not already been defined.
|
2008-02-23 14:08:55 +05:30
|
|
|
|
|
|
|
If not set_gid, then gramps_id is not set.
|
2007-10-10 01:32:02 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
|
|
|
|
2007-10-10 01:32:02 +05:30
|
|
|
def add_event(self, event, transaction, set_gid=True):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Add an Event to the database, assigning internal IDs if they have
|
2004-08-13 10:04:07 +05:30
|
|
|
not already been defined.
|
2008-02-23 14:08:55 +05:30
|
|
|
|
|
|
|
If not set_gid, then gramps_id is not set.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def add_person_event(self, event, transaction):
|
2006-04-01 05:16:34 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Add an Event to the database, assigning internal IDs if they have
|
2006-04-01 05:16:34 +05:30
|
|
|
not already been defined.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-04-01 05:16:34 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def add_family_event(self, event, transaction):
|
2006-04-01 05:16:34 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Add an Event to the database, assigning internal IDs if they have
|
2006-04-01 05:16:34 +05:30
|
|
|
not already been defined.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-04-01 05:16:34 +05:30
|
|
|
|
2007-10-10 01:32:02 +05:30
|
|
|
def add_place(self, place, transaction, set_gid=True):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Add a Place to the database, assigning internal IDs if they have
|
2004-08-13 10:04:07 +05:30
|
|
|
not already been defined.
|
2008-02-23 14:08:55 +05:30
|
|
|
|
|
|
|
If not set_gid, then gramps_id is not set.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2007-10-10 01:32:02 +05:30
|
|
|
def add_object(self, obj, transaction, set_gid=True):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Add a MediaObject to the database, assigning internal IDs if they have
|
2004-08-13 10:04:07 +05:30
|
|
|
not already been defined.
|
2008-02-23 14:08:55 +05:30
|
|
|
|
|
|
|
If not set_gid, then gramps_id is not set.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2007-10-10 01:32:02 +05:30
|
|
|
def add_repository(self, obj, transaction, set_gid=True):
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Add a Repository to the database, assigning internal IDs if they have
|
2005-05-27 23:13:04 +05:30
|
|
|
not already been defined.
|
2008-02-23 14:08:55 +05:30
|
|
|
|
|
|
|
If not set_gid, then gramps_id is not set.
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2007-10-10 01:32:02 +05:30
|
|
|
def add_note(self, obj, transaction, set_gid=True):
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Add a Note to the database, assigning internal IDs if they have
|
2007-02-20 06:09:10 +05:30
|
|
|
not already been defined.
|
2008-02-23 14:08:55 +05:30
|
|
|
|
|
|
|
If not set_gid, then gramps_id is not set.
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_name_group_mapping(self, name):
|
2004-10-01 00:02:56 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the default grouping name for a surname.
|
2004-10-01 00:02:56 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-10-01 00:02:56 +05:30
|
|
|
|
|
|
|
def get_name_group_keys(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the defined names that have been assigned to a default grouping.
|
2004-10-01 00:02:56 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-10-01 00:02:56 +05:30
|
|
|
|
2007-12-09 15:48:59 +05:30
|
|
|
def has_name_group_key(self, name):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return if a key exists in the name_group table.
|
2007-12-09 15:48:59 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-12-09 15:48:59 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_name_group_mapping(self, name, group):
|
2004-10-01 00:02:56 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Set the default grouping name for a surname.
|
|
|
|
|
|
|
|
Needs to be overridden in the derived class.
|
2004-10-01 00:02:56 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2009-06-16 21:19:17 +05:30
|
|
|
|
2004-08-01 09:51:31 +05:30
|
|
|
def get_number_of_people(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the number of people currently in the database.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2005-08-18 11:28:28 +05:30
|
|
|
def get_number_of_families(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the number of families currently in the database.
|
2005-08-18 11:28:28 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-08-18 11:28:28 +05:30
|
|
|
|
|
|
|
def get_number_of_events(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the number of events currently in the database.
|
2005-08-18 11:28:28 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-08-18 11:28:28 +05:30
|
|
|
|
|
|
|
def get_number_of_places(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the number of places currently in the database.
|
2005-08-18 11:28:28 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-08-18 11:28:28 +05:30
|
|
|
|
|
|
|
def get_number_of_sources(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the number of sources currently in the database.
|
2005-08-18 11:28:28 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-08-18 11:28:28 +05:30
|
|
|
|
|
|
|
def get_number_of_media_objects(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the number of media objects currently in the database.
|
2005-08-18 11:28:28 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-08-18 11:28:28 +05:30
|
|
|
|
2006-01-07 02:25:49 +05:30
|
|
|
def get_number_of_repositories(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the number of source repositories currently in the database.
|
2006-01-07 02:25:49 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-01-07 02:25:49 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def get_number_of_notes(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the number of notes currently in the database.
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2007-06-26 11:32:17 +05:30
|
|
|
def all_handles(self, table):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return all handles from the specified table as a list
|
|
|
|
"""
|
2006-01-11 03:58:09 +05:30
|
|
|
return table.keys()
|
2009-06-12 21:47:07 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_person_handles(self, sort_handles=True):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return a list of database handles, one handle for each Person in
|
|
|
|
the database.
|
|
|
|
|
|
|
|
If sort_handles is True, the list is sorted by surnames.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def get_family_handles(self):
|
2009-06-12 21:47:07 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Return a list of database handles, one handle for each Family in
|
|
|
|
the database.
|
2009-06-12 21:47:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2009-09-04 01:14:01 +05:30
|
|
|
|
|
|
|
def get_event_handles(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Return a list of database handles, one handle for each Event in the
|
|
|
|
database.
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2009-06-12 21:47:07 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_place_handles(self, sort_handles=True):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return a list of database handles, one handle for each Place in
|
|
|
|
the database.
|
|
|
|
|
|
|
|
If sort_handles is True, the list is sorted by Place title.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2009-09-04 01:14:01 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_source_handles(self, sort_handles=True):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return a list of database handles, one handle for each Source in
|
|
|
|
the database.
|
|
|
|
|
2009-09-01 00:12:29 +05:30
|
|
|
If sort_handles is True, the list is sorted by Source title.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2009-09-04 01:14:01 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_media_object_handles(self, sort_handles=True):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return a list of database handles, one handle for each MediaObject in
|
|
|
|
the database.
|
|
|
|
|
|
|
|
If sort_handles is True, the list is sorted by title.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def get_repository_handles(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Return a list of database handles, one handle for each Repository in
|
|
|
|
the database.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2009-09-04 01:14:01 +05:30
|
|
|
|
|
|
|
def get_note_handles(self):
|
2009-06-12 21:47:07 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Return a list of database handles, one handle for each Note in the
|
|
|
|
database.
|
2009-06-12 21:47:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def iter_person_handles(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Return an iterator over handles for Persons in the database
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2009-06-12 21:47:07 +05:30
|
|
|
|
|
|
|
def iter_family_handles(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over handles for Families in the database
|
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
def iter_event_handles(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over handles for Events in the database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
def iter_place_handles(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over handles for Places in the database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2004-08-13 10:04:07 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def iter_source_handles(self):
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Return an iterator over handles for Sources in the database
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2009-06-12 21:47:07 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def iter_media_object_handles(self):
|
2009-06-12 21:47:07 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Return an iterator over handles for Media in the database
|
2009-06-12 21:47:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def iter_repository_handles(self):
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
Return an iterator over handles for Repositories in the database
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2009-06-12 21:47:07 +05:30
|
|
|
|
|
|
|
def iter_note_handles(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over handles for Notes in the database
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def iter_people(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over objects for Persons in the database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
def iter_families(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over objects for Families in the database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
def iter_events(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over objects for Events in the database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
def iter_places(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over objects for Places in the database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
def iter_sources(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over objects for Sources in the database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
def iter_media_objects(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over objects for MediaObjects in the database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
def iter_repositories(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over objects for Repositories in the database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
def iter_notes(self):
|
|
|
|
"""
|
|
|
|
Return an iterator over objects for Notes in the database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_gramps_ids(self, obj_key):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Returns all the keys from a table given a table name
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def has_gramps_id(self, obj_key, gramps_id):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Returns True if the key exists in table given a table name
|
|
|
|
|
|
|
|
Not used in current codebase
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2006-01-31 07:11:55 +05:30
|
|
|
|
2006-01-30 03:35:20 +05:30
|
|
|
def find_initial_person(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Returns first person in the database
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_person_id_prefix(self, val):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Set the naming template for GRAMPS Person ID values.
|
|
|
|
|
|
|
|
The string is expected to be in the form of a simple text string, or
|
|
|
|
in a format that contains a C/Python style format string using %d,
|
|
|
|
such as I%d or I%04d.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_source_id_prefix(self, val):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Set the naming template for GRAMPS Source ID values.
|
|
|
|
|
|
|
|
The string is expected to be in the form of a simple text string, or
|
|
|
|
in a format that contains a C/Python style format string using %d,
|
|
|
|
such as S%d or S%04d.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_object_id_prefix(self, val):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Set the naming template for GRAMPS MediaObject ID values.
|
|
|
|
|
|
|
|
The string is expected to be in the form of a simple text string, or
|
|
|
|
in a format that contains a C/Python style format string using %d,
|
|
|
|
such as O%d or O%04d.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_place_id_prefix(self, val):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Set the naming template for GRAMPS Place ID values.
|
|
|
|
|
|
|
|
The string is expected to be in the form of a simple text string, or
|
|
|
|
in a format that contains a C/Python style format string using %d,
|
|
|
|
such as P%d or P%04d.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_family_id_prefix(self, val):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Set the naming template for GRAMPS Family ID values. The string is
|
2005-04-18 04:04:56 +05:30
|
|
|
expected to be in the form of a simple text string, or in a format
|
|
|
|
that contains a C/Python style format string using %d, such as F%d
|
|
|
|
or F%04d.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_event_id_prefix(self, val):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Set the naming template for GRAMPS Event ID values.
|
|
|
|
|
|
|
|
The string is expected to be in the form of a simple text string, or
|
|
|
|
in a format that contains a C/Python style format string using %d,
|
|
|
|
such as E%d or E%04d.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_repository_id_prefix(self, val):
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Set the naming template for GRAMPS Repository ID values.
|
|
|
|
|
|
|
|
The string is expected to be in the form of a simple text string, or
|
|
|
|
in a format that contains a C/Python style format string using %d,
|
|
|
|
such as R%d or R%04d.
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-10-29 10:06:08 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def set_note_id_prefix(self, val):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Set the naming template for GRAMPS Note ID values.
|
|
|
|
|
|
|
|
The string is expected to be in the form of a simple text string, or
|
|
|
|
in a format that contains a C/Python style format string using %d,
|
|
|
|
such as N%d or N%04d.
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2007-04-02 09:26:30 +05:30
|
|
|
def transaction_begin(self, msg="", batch=False, no_magic=False):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Create a new Transaction tied to the current UNDO database.
|
|
|
|
|
|
|
|
The transaction has no effect until it is committed using the
|
2005-04-18 04:04:56 +05:30
|
|
|
transaction_commit function of the this database object.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def transaction_commit(self, transaction, msg):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Commit the transaction to the associated UNDO database.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-01-13 03:32:58 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_undo_callback(self, callback):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Define the callback function that is called whenever an undo operation
|
|
|
|
is executed.
|
|
|
|
|
|
|
|
The callback function receives a single argument that is a text string
|
|
|
|
that defines the operation.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-13 10:04:07 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_redo_callback(self, callback):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Define the callback function that is called whenever an redo operation
|
|
|
|
is executed.
|
|
|
|
|
|
|
|
The callback function receives a single argument that is a text string
|
|
|
|
that defines the operation.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-13 10:04:07 +05:30
|
|
|
|
|
|
|
def get_surname_list(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the list of locale-sorted surnames contained in the database.
|
2007-01-19 22:23:49 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-01-19 22:23:49 +05:30
|
|
|
|
|
|
|
def build_surname_list(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Build the list of locale-sorted surnames contained in the database.
|
2007-01-19 22:23:49 +05:30
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2007-01-19 22:23:49 +05:30
|
|
|
|
|
|
|
def sort_surname_list(self):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Sort the list of surnames contained in the database by locale ordering.
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2007-01-19 22:23:49 +05:30
|
|
|
|
2007-06-04 08:19:31 +05:30
|
|
|
def add_to_surname_list(self, person, batch_transaction):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Add surname from given person to list of surnames
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2007-01-19 22:23:49 +05:30
|
|
|
if batch_transaction:
|
|
|
|
return
|
|
|
|
name = unicode(person.get_primary_name().get_surname())
|
|
|
|
if name not in self.surname_list:
|
|
|
|
self.surname_list.append(name)
|
|
|
|
self.sort_surname_list()
|
|
|
|
|
2007-06-04 08:19:31 +05:30
|
|
|
def remove_from_surname_list(self, person):
|
2007-01-19 22:23:49 +05:30
|
|
|
"""
|
|
|
|
Check whether there are persons with the same surname left in
|
2008-02-23 14:08:55 +05:30
|
|
|
the database.
|
|
|
|
|
|
|
|
If not then we need to remove the name from the list.
|
2004-08-13 10:04:07 +05:30
|
|
|
The function must be overridden in the derived class.
|
|
|
|
"""
|
2007-05-07 09:09:46 +05:30
|
|
|
raise NotImplementedError
|
2004-08-13 10:04:07 +05:30
|
|
|
|
2004-08-01 09:51:31 +05:30
|
|
|
def get_bookmarks(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the list of Person handles in the bookmarks."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-27 03:18:13 +05:30
|
|
|
def get_family_bookmarks(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the list of Person handles in the bookmarks."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-04-27 03:18:13 +05:30
|
|
|
|
|
|
|
def get_event_bookmarks(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the list of Person handles in the bookmarks."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-04-27 03:18:13 +05:30
|
|
|
|
|
|
|
def get_place_bookmarks(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the list of Person handles in the bookmarks."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-04-27 03:18:13 +05:30
|
|
|
|
|
|
|
def get_source_bookmarks(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the list of Person handles in the bookmarks."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-04-27 03:18:13 +05:30
|
|
|
|
|
|
|
def get_media_bookmarks(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the list of Person handles in the bookmarks."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-04-27 03:18:13 +05:30
|
|
|
|
|
|
|
def get_repo_bookmarks(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the list of Person handles in the bookmarks."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-04-27 03:18:13 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def get_note_bookmarks(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the list of Note handles in the bookmarks."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_researcher(self, owner):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Set the information about the owner of the database."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
|
|
|
def get_researcher(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
|
|
|
Return the Researcher instance, providing information about the owner
|
|
|
|
of the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_default_person_handle(self, handle):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Set the default Person to the passed instance."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
|
|
|
def get_default_person(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the default Person of the database."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-05-09 09:45:04 +05:30
|
|
|
def get_default_handle(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the default Person of the database."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-09 09:45:04 +05:30
|
|
|
|
2004-08-01 09:51:31 +05:30
|
|
|
def get_save_path(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the save path of the file, or "" if one does not exist."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_save_path(self, path):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Set the save path for the database."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
|
|
|
def get_person_event_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all Event types associated with Person instances in
|
2008-02-23 14:08:55 +05:30
|
|
|
the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
|
|
|
|
2004-08-01 09:51:31 +05:30
|
|
|
def get_person_attribute_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all Attribute types associated with Person instances
|
2008-02-23 14:08:55 +05:30
|
|
|
in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
|
|
|
|
2004-08-01 09:51:31 +05:30
|
|
|
def get_family_attribute_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all Attribute types associated with Family instances
|
2008-02-23 14:08:55 +05:30
|
|
|
in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
|
|
|
|
2004-08-01 09:51:31 +05:30
|
|
|
def get_family_event_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all Event types associated with Family instances in
|
2008-02-23 14:08:55 +05:30
|
|
|
the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_marker_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
|
|
|
Return a list of all marker types available in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-09-16 20:55:27 +05:30
|
|
|
|
2004-08-01 09:51:31 +05:30
|
|
|
def get_media_attribute_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all Attribute types associated with Media and MediaRef
|
2008-02-23 14:08:55 +05:30
|
|
|
instances in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
|
|
|
def get_family_relation_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all relationship types associated with Family
|
2008-02-23 14:08:55 +05:30
|
|
|
instances in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-19 23:02:23 +05:30
|
|
|
|
|
|
|
def get_child_reference_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all child reference types associated with Family
|
2008-02-23 14:08:55 +05:30
|
|
|
instances in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-19 23:02:23 +05:30
|
|
|
|
|
|
|
def get_event_roles(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all custom event role names associated with Event
|
2008-02-23 14:08:55 +05:30
|
|
|
instances in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-19 23:02:23 +05:30
|
|
|
|
|
|
|
def get_name_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all custom names types associated with Person
|
2008-02-23 14:08:55 +05:30
|
|
|
instances in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-19 23:02:23 +05:30
|
|
|
|
|
|
|
def get_repository_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all custom repository types associated with Repository
|
2008-02-23 14:08:55 +05:30
|
|
|
instances in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-19 23:02:23 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def get_note_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all custom note types associated with Note instances
|
2008-02-23 14:08:55 +05:30
|
|
|
in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2006-05-19 23:02:23 +05:30
|
|
|
def get_source_media_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all custom source media types associated with Source
|
2008-02-23 14:08:55 +05:30
|
|
|
instances in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-05-19 23:02:23 +05:30
|
|
|
|
|
|
|
def get_url_types(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
2009-08-09 22:39:32 +05:30
|
|
|
Return a list of all custom names types associated with Url instances
|
2008-02-23 14:08:55 +05:30
|
|
|
in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def remove_person(self, handle, transaction):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Remove the Person specified by the database handle from the database,
|
|
|
|
preserving the change in the passed transaction.
|
|
|
|
|
|
|
|
This method must be overridden in the derived class.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-04-18 04:04:56 +05:30
|
|
|
|
2007-06-04 08:19:31 +05:30
|
|
|
def get_del_func(self, key):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Returns the key of an object to delete
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2004-08-13 10:04:07 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def remove_source(self, handle, transaction):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Remove the Source specified by the database handle from the
|
|
|
|
database, preserving the change in the passed transaction.
|
|
|
|
|
|
|
|
This method must be overridden in the derived class.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-13 10:04:07 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def remove_event(self, handle, transaction):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Remove the Event specified by the database handle from the
|
|
|
|
database, preserving the change in the passed transaction.
|
|
|
|
|
|
|
|
This method must be overridden in the derived class.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def remove_object(self, handle, transaction):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Remove the MediaObjectPerson specified by the database handle from the
|
|
|
|
database, preserving the change in the passed transaction.
|
|
|
|
|
|
|
|
This method must be overridden in the derived class.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def remove_place(self, handle, transaction):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Remove the Place specified by the database handle from the
|
|
|
|
database, preserving the change in the passed transaction.
|
|
|
|
|
|
|
|
This method must be overridden in the derived class.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-13 10:04:07 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def remove_family(self, handle, transaction):
|
2004-12-03 07:19:09 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Remove the Family specified by the database handle from the
|
|
|
|
database, preserving the change in the passed transaction.
|
|
|
|
|
|
|
|
This method must be overridden in the derived class.
|
2004-12-03 07:19:09 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-12-03 07:19:09 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def remove_repository(self, handle, transaction):
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Remove the Repository specified by the database handle from the
|
|
|
|
database, preserving the change in the passed transaction.
|
|
|
|
|
|
|
|
This method must be overridden in the derived class.
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def remove_note(self, handle, transaction):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Remove the Note specified by the database handle from the
|
|
|
|
database, preserving the change in the passed transaction.
|
|
|
|
|
|
|
|
This method must be overridden in the derived class.
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_raw_person_data(self, handle):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return raw (serialized and pickled) Person object from handle
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2006-01-07 03:38:40 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_raw_family_data(self, handle):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return raw (serialized and pickled) Family object from handle
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2006-01-07 03:38:40 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_raw_object_data(self, handle):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return raw (serialized and pickled) Family object from handle
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2006-01-07 03:38:40 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_raw_place_data(self, handle):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return raw (serialized and pickled) Place object from handle
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2006-01-07 03:38:40 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_raw_event_data(self, handle):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return raw (serialized and pickled) Event object from handle
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2006-01-07 03:38:40 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_raw_source_data(self, handle):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return raw (serialized and pickled) Source object from handle
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2006-01-07 03:38:40 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def get_raw_repository_data(self, handle):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return raw (serialized and pickled) Repository object from handle
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2006-01-07 03:38:40 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def get_raw_note_data(self, handle):
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Return raw (serialized and pickled) Note object from handle
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def has_person_handle(self, handle):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return True if the handle exists in the current Person database.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-13 10:04:07 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def has_event_handle(self, handle):
|
2006-01-07 03:38:40 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return True if the handle exists in the current Event database.
|
2006-01-07 03:38:40 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-01-07 03:38:40 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def has_source_handle(self, handle):
|
2006-01-07 03:38:40 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return True if the handle exists in the current Source database.
|
2006-01-07 03:38:40 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-01-07 03:38:40 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def has_place_handle(self, handle):
|
2006-01-07 03:38:40 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return True if the handle exists in the current Place database.
|
2006-01-07 03:38:40 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-01-07 03:38:40 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def has_family_handle(self, handle):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return True if the handle exists in the current Family database.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-11 09:12:38 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def has_object_handle(self, handle):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return True if the handle exists in the current MediaObjectdatabase.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def has_repository_handle(self, handle):
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return True if the handle exists in the current Repository database.
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def has_note_handle(self, handle):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return True if the handle exists in the current Note database.
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2009-06-12 21:47:07 +05:30
|
|
|
|
2007-12-01 05:20:05 +05:30
|
|
|
def set_mediapath(self, path):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Set the default media path for database, path should be utf-8."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-12-01 05:20:05 +05:30
|
|
|
|
|
|
|
def get_mediapath(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""Return the default media path of the database."""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-04-18 04:04:56 +05:30
|
|
|
|
2009-09-04 01:14:01 +05:30
|
|
|
def set_column_order(self, col_list, name):
|
|
|
|
"""
|
|
|
|
Store the display information in the database's metadata.
|
|
|
|
"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_person_column_order(self, col_list):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Store the Person display common information in the database's metadata.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_family_list_column_order(self, col_list):
|
2006-01-08 11:14:19 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Store the Person display common information in the database's metadata.
|
2006-01-08 11:14:19 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-01-08 11:14:19 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_child_column_order(self, col_list):
|
2004-11-19 01:51:06 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Store the Person display common information in the database's metadata.
|
2004-11-19 01:51:06 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-11-19 01:51:06 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_place_column_order(self, col_list):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Store the Place display common information in the database's metadata.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_source_column_order(self, col_list):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Store the Source display common information in the database's metadata.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_media_column_order(self, col_list):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Store the Media display common information in the database's metadata.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_event_column_order(self, col_list):
|
2005-06-08 21:05:31 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Store the Event display common information in the database's metadata.
|
2005-06-08 21:05:31 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-06-08 21:05:31 +05:30
|
|
|
|
2006-04-08 02:36:20 +05:30
|
|
|
def set_repository_column_order(self, col_list):
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Store the Repository display common information in the database's
|
|
|
|
metadata.
|
2005-05-27 23:13:04 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def set_note_column_order(self, col_list):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Store the Note display common information in the database's metadata.
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2005-04-18 04:04:56 +05:30
|
|
|
def get_person_column_order(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the Person display common information stored in the database's
|
|
|
|
metadata.
|
2005-04-18 04:04:56 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
|
|
|
|
2006-01-08 11:14:19 +05:30
|
|
|
def get_family_list_column_order(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the Person display common information stored in the database's
|
|
|
|
metadata.
|
2006-01-08 11:14:19 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-01-08 11:14:19 +05:30
|
|
|
|
2004-11-19 01:51:06 +05:30
|
|
|
def get_child_column_order(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the Person display common information stored in the database's
|
|
|
|
metadata.
|
2004-11-19 01:51:06 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-11-19 01:51:06 +05:30
|
|
|
|
2004-08-01 09:51:31 +05:30
|
|
|
def get_place_column_order(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the Place display common information stored in thedatabase's
|
|
|
|
metadata.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
|
|
|
def get_source_column_order(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the Source display common information stored in the database's
|
|
|
|
metadata.
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-08-01 09:51:31 +05:30
|
|
|
|
|
|
|
def get_media_column_order(self):
|
2004-08-13 10:04:07 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the MediaObject display common information stored in the
|
2004-08-13 10:04:07 +05:30
|
|
|
database's metadata.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2004-10-23 09:26:48 +05:30
|
|
|
|
2005-06-07 10:38:50 +05:30
|
|
|
def get_event_column_order(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the Event display common information stored in the database's
|
|
|
|
metadata.
|
2005-06-07 10:38:50 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-06-07 10:38:50 +05:30
|
|
|
|
2005-05-27 23:13:04 +05:30
|
|
|
def get_repository_column_order(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the Repository display common information stored in the
|
2005-05-27 23:13:04 +05:30
|
|
|
database's metadata.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-05-27 23:13:04 +05:30
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
def get_note_column_order(self):
|
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Return the Note display common information stored in the database's
|
|
|
|
metadata.
|
2007-02-20 06:09:10 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-02-20 06:09:10 +05:30
|
|
|
|
2007-06-26 11:32:17 +05:30
|
|
|
def delete_primary_from_reference_map(self, handle, transaction):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
|
|
|
Called each time an object is removed from the database.
|
|
|
|
|
|
|
|
This can be used by subclasses to update any additional index tables
|
|
|
|
that might need to be changed.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-01-13 03:32:58 +05:30
|
|
|
|
2007-06-26 11:32:17 +05:30
|
|
|
def update_reference_map(self, obj, transaction):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
|
|
|
Called each time an object is writen to the database.
|
|
|
|
|
|
|
|
This can be used by subclasses to update any additional index tables
|
|
|
|
that might need to be changed.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2005-12-15 17:33:24 +05:30
|
|
|
|
2007-06-04 08:19:31 +05:30
|
|
|
def reindex_reference_map(self, callback):
|
2006-12-01 13:53:51 +05:30
|
|
|
"""
|
|
|
|
Reindex all primary records in the database.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2006-12-01 13:53:51 +05:30
|
|
|
|
2005-12-15 17:33:24 +05:30
|
|
|
def find_backlink_handles(self, handle, include_classes=None):
|
|
|
|
"""
|
|
|
|
Find all objects that hold a reference to the object handle.
|
2008-02-23 14:08:55 +05:30
|
|
|
|
2009-08-10 04:13:43 +05:30
|
|
|
Returns an iterator over a list of (class_name, handle) tuples.
|
2009-09-04 01:14:01 +05:30
|
|
|
|
|
|
|
:param handle: handle of the object to search for.
|
|
|
|
:type handle: database handle
|
|
|
|
:param include_classes: list of class names to include in the results.
|
|
|
|
Default is None which includes all classes.
|
|
|
|
:type include_classes: list of class names
|
2005-12-15 17:33:24 +05:30
|
|
|
|
2009-08-10 04:13:43 +05:30
|
|
|
This default implementation does a sequential scan through all
|
2005-12-15 17:33:24 +05:30
|
|
|
the primary object databases and is very slow. Backends can
|
|
|
|
override this method to provide much faster implementations that
|
|
|
|
make use of additional capabilities of the backend.
|
2009-09-04 01:14:01 +05:30
|
|
|
|
2005-12-15 17:33:24 +05:30
|
|
|
Note that this is a generator function, it returns a iterator for
|
2009-09-04 01:14:01 +05:30
|
|
|
use in loops. If you want a list of the results use::
|
|
|
|
|
|
|
|
result_list = list(find_backlink_handles(handle))
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
2009-09-04 01:14:01 +05:30
|
|
|
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-10-05 14:55:31 +05:30
|
|
|
|
|
|
|
def report_bm_change(self):
|
2007-10-05 15:00:27 +05:30
|
|
|
"""
|
2008-02-23 14:08:55 +05:30
|
|
|
Add 1 to the number of bookmark changes during this session.
|
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2007-10-05 14:55:31 +05:30
|
|
|
|
|
|
|
def db_has_bm_changes(self):
|
2008-02-23 14:08:55 +05:30
|
|
|
"""
|
|
|
|
Return whethere there were bookmark changes during the session.
|
2007-10-05 15:00:27 +05:30
|
|
|
"""
|
2009-09-01 00:12:29 +05:30
|
|
|
raise NotImplementedError
|
2009-12-21 03:51:59 +05:30
|
|
|
|
|
|
|
def get_birth_or_fallback(self, person):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
birth_ref = person.get_birth_ref()
|
|
|
|
if birth_ref: # regular birth found
|
|
|
|
event = self.get_event_from_handle(birth_ref.ref)
|
|
|
|
if event:
|
|
|
|
return event
|
|
|
|
# now search the event list for fallbacks
|
|
|
|
for event_ref in person.get_primary_event_ref_list():
|
|
|
|
if event_ref:
|
|
|
|
event = self.get_event_from_handle(event_ref.ref)
|
|
|
|
if (event
|
|
|
|
and event.type.is_birth_fallback()
|
|
|
|
and event_ref.role.is_primary()):
|
|
|
|
return event
|
|
|
|
return None
|
|
|
|
|
|
|
|
def get_death_or_fallback(self, person):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
death_ref = person.get_death_ref()
|
|
|
|
if death_ref: # regular death found
|
|
|
|
event = self.get_event_from_handle(death_ref.ref)
|
|
|
|
if event:
|
|
|
|
return event
|
|
|
|
# now search the event list for fallbacks
|
|
|
|
for event_ref in person.get_primary_event_ref_list():
|
|
|
|
if event_ref:
|
|
|
|
event = self.get_event_from_handle(event_ref.ref)
|
|
|
|
if (event
|
|
|
|
and event.type.is_death_fallback()
|
|
|
|
and event_ref.role.is_primary()):
|
|
|
|
return event
|
|
|
|
return None
|
|
|
|
|