Inverse filters will show differences between previous proxy

svn: r15514
This commit is contained in:
Doug Blank 2010-05-30 14:03:29 +00:00
parent 61905f3681
commit 01ef2759d4

View File

@ -107,75 +107,75 @@ def run(database, document, filter_name, *args, **kwargs):
sdoc.paragraph("") sdoc.paragraph("")
matches = 0 matches = 0
if (filter_name == 'Inverse Person'): if (filter_name == 'Inverse Person'):
sdb.dbase = database.basedb sdb.dbase = database.db
stab.columns(_("Person"), _("Gramps ID"), _("Birth Date")) stab.columns(_("Person"), _("Gramps ID"), _("Birth Date"))
proxy_handles = dict([(handle,1) for handle in proxy_handles = dict([(handle,1) for handle in
database.iter_person_handles()]) database.iter_person_handles()])
for person in database.basedb.iter_people(): for person in database.db.iter_people():
if person.handle not in proxy_handles: if person.handle not in proxy_handles:
stab.row(person, person.gramps_id, stab.row(person, person.gramps_id,
sdb.birth_or_fallback(person)) sdb.birth_or_fallback(person))
matches += 1 matches += 1
elif (filter_name == 'Inverse Family'): elif (filter_name == 'Inverse Family'):
sdb.dbase = database.basedb sdb.dbase = database.db
stab.columns(_("Family"), _("Gramps ID")) stab.columns(_("Family"), _("Gramps ID"))
proxy_handles = dict([(handle,1) for handle in proxy_handles = dict([(handle,1) for handle in
database.iter_family_handles()]) database.iter_family_handles()])
for family in database.basedb.iter_families(): for family in database.db.iter_families():
if family.handle not in proxy_handles: if family.handle not in proxy_handles:
stab.row(family, family.gramps_id) stab.row(family, family.gramps_id)
matches += 1 matches += 1
elif (filter_name == 'Inverse Event'): elif (filter_name == 'Inverse Event'):
sdb.dbase = database.basedb sdb.dbase = database.db
stab.columns(_("Event"), _("Gramps ID")) stab.columns(_("Event"), _("Gramps ID"))
proxy_handles = dict([(handle,1) for handle in proxy_handles = dict([(handle,1) for handle in
database.iter_event_handles()]) database.iter_event_handles()])
for event in database.basedb.iter_events(): for event in database.db.iter_events():
if event.handle not in proxy_handles: if event.handle not in proxy_handles:
stab.row(event, event.gramps_id) stab.row(event, event.gramps_id)
matches += 1 matches += 1
elif (filter_name == 'Inverse Place'): elif (filter_name == 'Inverse Place'):
sdb.dbase = database.basedb sdb.dbase = database.db
stab.columns(_("Place"), _("Gramps ID")) stab.columns(_("Place"), _("Gramps ID"))
proxy_handles = dict([(handle,1) for handle in proxy_handles = dict([(handle,1) for handle in
database.iter_place_handles()]) database.iter_place_handles()])
for place in database.basedb.iter_places(): for place in database.db.iter_places():
if place.handle not in proxy_handles: if place.handle not in proxy_handles:
stab.row(place, place.gramps_id) stab.row(place, place.gramps_id)
matches += 1 matches += 1
elif (filter_name == 'Inverse Source'): elif (filter_name == 'Inverse Source'):
sdb.dbase = database.basedb sdb.dbase = database.db
stab.columns(_("Source"), _("Gramps ID")) stab.columns(_("Source"), _("Gramps ID"))
proxy_handles = dict([(handle,1) for handle in proxy_handles = dict([(handle,1) for handle in
database.iter_source_handles()]) database.iter_source_handles()])
for source in database.basedb.iter_sources(): for source in database.db.iter_sources():
if source.handle not in proxy_handles: if source.handle not in proxy_handles:
stab.row(source, source.gramps_id) stab.row(source, source.gramps_id)
matches += 1 matches += 1
elif (filter_name == 'Inverse Repository'): elif (filter_name == 'Inverse Repository'):
sdb.dbase = database.basedb sdb.dbase = database.db
stab.columns(_("Repository"), _("Gramps ID")) stab.columns(_("Repository"), _("Gramps ID"))
proxy_handles = dict([(handle,1) for handle in proxy_handles = dict([(handle,1) for handle in
database.iter_repository_handles()]) database.iter_repository_handles()])
for repository in database.basedb.iter_repositories(): for repository in database.db.iter_repositories():
if repository.handle not in proxy_handles: if repository.handle not in proxy_handles:
stab.row(repository, repository.gramps_id) stab.row(repository, repository.gramps_id)
matches += 1 matches += 1
elif (filter_name == 'Inverse MediaObject'): elif (filter_name == 'Inverse MediaObject'):
sdb.dbase = database.basedb sdb.dbase = database.db
stab.columns(_("Media"), _("Gramps ID")) stab.columns(_("Media"), _("Gramps ID"))
proxy_handles = dict([(handle,1) for handle in proxy_handles = dict([(handle,1) for handle in
database.iter_media_object_handles()]) database.iter_media_object_handles()])
for media in database.basedb.iter_media_objects(): for media in database.db.iter_media_objects():
if media.handle not in proxy_handles: if media.handle not in proxy_handles:
stab.row(media, media.gramps_id) stab.row(media, media.gramps_id)
matches += 1 matches += 1
elif (filter_name == 'Inverse Note'): elif (filter_name == 'Inverse Note'):
sdb.dbase = database.basedb sdb.dbase = database.db
stab.columns(_("Note"), _("Gramps ID")) stab.columns(_("Note"), _("Gramps ID"))
proxy_handles = dict([(handle,1) for handle in proxy_handles = dict([(handle,1) for handle in
database.iter_note_handles()]) database.iter_note_handles()])
for note in database.basedb.iter_notes(): for note in database.db.iter_notes():
if note.handle not in proxy_handles: if note.handle not in proxy_handles:
stab.row(note, note.gramps_id) stab.row(note, note.gramps_id)
matches += 1 matches += 1