Database API: add common count_func to _tables

This commit is contained in:
Doug Blank 2015-08-08 09:51:31 -04:00
parent 044307661b
commit fe73500545
2 changed files with 20 additions and 10 deletions

View File

@ -446,7 +446,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
"ids_func": self.get_person_gramps_ids,
"has_handle_func": self.has_handle_for_person,
"has_gramps_id_func": self.has_gramps_id_for_person,
"count": self.get_number_of_people,
"count_func": self.get_number_of_people,
"raw_func": self._get_raw_person_data,
"raw_id_func": self._get_raw_person_from_id_data,
"del_func": self.remove_person,
@ -464,7 +464,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
"ids_func": self.get_family_gramps_ids,
"has_handle_func": self.has_handle_for_family,
"has_gramps_id_func": self.has_gramps_id_for_family,
"count": self.get_number_of_families,
"count_func": self.get_number_of_families,
"raw_func": self._get_raw_family_data,
"raw_id_func": self._get_raw_family_from_id_data,
"del_func": self.remove_family,
@ -482,7 +482,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
"ids_func": self.get_source_gramps_ids,
"has_handle_func": self.has_handle_for_source,
"has_gramps_id_func": self.has_gramps_id_for_source,
"count": self.get_number_of_sources,
"count_func": self.get_number_of_sources,
"raw_func": self._get_raw_source_data,
"raw_id_func": self._get_raw_source_from_id_data,
"del_func": self.remove_source,
@ -500,7 +500,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
"ids_func": self.get_citation_gramps_ids,
"has_handle_func": self.has_handle_for_citation,
"has_gramps_id_func": self.has_gramps_id_for_citation,
"count": self.get_number_of_citations,
"count_func": self.get_number_of_citations,
"raw_func": self._get_raw_citation_data,
"raw_id_func": self._get_raw_citation_from_id_data,
"del_func": self.remove_citation,
@ -518,7 +518,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
"ids_func": self.get_event_gramps_ids,
"has_handle_func": self.has_handle_for_event,
"has_gramps_id_func": self.has_gramps_id_for_event,
"count": self.get_number_of_events,
"count_func": self.get_number_of_events,
"raw_func": self._get_raw_event_data,
"raw_id_func": self._get_raw_event_from_id_data,
"del_func": self.remove_event,
@ -536,7 +536,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
"ids_func": self.get_media_gramps_ids,
"has_handle_func": self.has_handle_for_media,
"has_gramps_id_func": self.has_gramps_id_for_media,
"count": self.get_number_of_media_objects,
"count_func": self.get_number_of_media_objects,
"raw_func": self._get_raw_media_data,
"raw_id_func": self._get_raw_media_from_id_data,
"del_func": self.remove_object,
@ -554,7 +554,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
"ids_func": self.get_place_gramps_ids,
"has_handle_func": self.has_handle_for_place,
"has_gramps_id_func": self.has_gramps_id_for_place,
"count": self.get_number_of_places,
"count_func": self.get_number_of_places,
"raw_func": self._get_raw_place_data,
"raw_id_func": self._get_raw_place_from_id_data,
"del_func": self.remove_place,
@ -572,7 +572,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
"ids_func": self.get_repository_gramps_ids,
"has_handle_func": self.has_handle_for_repository,
"has_gramps_id_func": self.has_gramps_id_for_repository,
"count": self.get_number_of_repositories,
"count_func": self.get_number_of_repositories,
"raw_func": self._get_raw_repository_data,
"raw_id_func": self._get_raw_repository_from_id_data,
"del_func": self.remove_repository,
@ -590,7 +590,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
"ids_func": self.get_note_gramps_ids,
"has_handle_func": self.has_handle_for_note,
"has_gramps_id_func": self.has_gramps_id_for_note,
"count": self.get_number_of_notes,
"count_func": self.get_number_of_notes,
"raw_func": self._get_raw_note_data,
"raw_id_func": self._get_raw_note_from_id_data,
"del_func": self.remove_note,
@ -606,7 +606,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
"commit_func": self.commit_tag,
"has_handle_func": self.has_handle_for_tag,
"iter_func": self.iter_tags,
"count": self.get_number_of_tags,
"count_func": self.get_number_of_tags,
"raw_func": self._get_raw_tag_data,
"del_func": self.remove_tag,
})

View File

@ -252,6 +252,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_person_handles,
"add_func": self.add_person,
"commit_func": self.commit_person,
"count_func": self.get_number_of_people,
})
self._tables['Family'].update(
{
@ -262,6 +263,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_family_handles,
"add_func": self.add_family,
"commit_func": self.commit_family,
"count_func": self.get_number_of_families,
})
self._tables['Source'].update(
{
@ -272,6 +274,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_source_handles,
"add_func": self.add_source,
"commit_func": self.commit_source,
"count_func": self.get_number_of_sources,
})
self._tables['Citation'].update(
{
@ -282,6 +285,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_citation_handles,
"add_func": self.add_citation,
"commit_func": self.commit_citation,
"count_func": self.get_number_of_citations,
})
self._tables['Event'].update(
{
@ -292,6 +296,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_event_handles,
"add_func": self.add_event,
"commit_func": self.commit_event,
"count_func": self.get_number_of_events,
})
self._tables['Media'].update(
{
@ -302,6 +307,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_media_object_handles,
"add_func": self.add_object,
"commit_func": self.commit_media_object,
"count_func": self.get_number_of_media_objects,
})
self._tables['Place'].update(
{
@ -312,6 +318,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_place_handles,
"add_func": self.add_place,
"commit_func": self.commit_place,
"count_func": self.get_number_of_places,
})
self._tables['Repository'].update(
{
@ -322,6 +329,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_repository_handles,
"add_func": self.add_repository,
"commit_func": self.commit_repository,
"count_func": self.get_number_of_repositories,
})
self._tables['Note'].update(
{
@ -332,6 +340,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_note_handles,
"add_func": self.add_note,
"commit_func": self.commit_note,
"count_func": self.get_number_of_notes,
})
self._tables['Tag'].update(
{
@ -342,6 +351,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
"handles_func": self.get_tag_handles,
"add_func": self.add_tag,
"commit_func": self.commit_tag,
"count_func": self.get_number_of_tags,
})
self.secondary_connected = False