parent
5cb9c3e30e
commit
755254cf7c
@ -800,21 +800,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
return self._get_table_func(table_name)
|
return self._get_table_func(table_name)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_from_name_and_gramps_id(self, table_name, gramps_id):
|
|
||||||
"""
|
|
||||||
Returns a gen.lib object (or None) given table_name and
|
|
||||||
Gramps ID.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
>>> self.get_from_name_and_gramps_id("Person", "I00002")
|
|
||||||
>>> self.get_from_name_and_gramps_id("Family", "F056")
|
|
||||||
>>> self.get_from_name_and_gramps_id("Media", "M00012")
|
|
||||||
"""
|
|
||||||
if table_name in self._get_table_func():
|
|
||||||
return self._get_table_func(table_name, "gramps_id_func")(gramps_id)
|
|
||||||
return None
|
|
||||||
|
|
||||||
def _txn_begin(self):
|
def _txn_begin(self):
|
||||||
"""
|
"""
|
||||||
Lowlevel interface to the backend transaction.
|
Lowlevel interface to the backend transaction.
|
||||||
|
@ -269,7 +269,8 @@ class EditReference(ManagedWindow, DbGUIElement):
|
|||||||
"""
|
"""
|
||||||
new_id = self.source.get_gramps_id()
|
new_id = self.source.get_gramps_id()
|
||||||
if new_id:
|
if new_id:
|
||||||
old_primary = self.db.get_from_name_and_gramps_id(type, new_id)
|
id_func = getattr(self.db, 'get_%s_from_gramps_id' % type.lower())
|
||||||
|
old_primary = id_func(new_id)
|
||||||
if old_primary:
|
if old_primary:
|
||||||
description = None
|
description = None
|
||||||
if type == 'Event':
|
if type == 'Event':
|
||||||
|
@ -488,21 +488,6 @@ class DbBsddbRead(DbReadBase, Callback):
|
|||||||
return self._get_table_func(table_name)
|
return self._get_table_func(table_name)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_from_name_and_gramps_id(self, table_name, gramps_id):
|
|
||||||
"""
|
|
||||||
Returns a gen.lib object (or None) given table_name and
|
|
||||||
Gramps ID.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
>>> self.get_from_name_and_gramps_id("Person", "I00002")
|
|
||||||
>>> self.get_from_name_and_gramps_id("Family", "F056")
|
|
||||||
>>> self.get_from_name_and_gramps_id("Media", "M00012")
|
|
||||||
"""
|
|
||||||
if table_name in self._get_table_func():
|
|
||||||
return self._get_table_func(table_name,"gramps_id_func")(gramps_id)
|
|
||||||
return None
|
|
||||||
|
|
||||||
def set_prefixes(self, person, media, family, source, citation, place,
|
def set_prefixes(self, person, media, family, source, citation, place,
|
||||||
event, repository, note):
|
event, repository, note):
|
||||||
self.set_person_id_prefix(person)
|
self.set_person_id_prefix(person)
|
||||||
|
Loading…
Reference in New Issue
Block a user