implement fetching sorted Person and Family handles in the proxy DBs

This commit is contained in:
Paul Franklin 2016-06-04 21:36:08 -07:00
parent 84130d221f
commit 21d02ad22c

View File

@ -320,9 +320,10 @@ class ProxyDbBase(DbReadBase):
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
"""
# FIXME: this is not a sorted list of handles
if self.db.is_open:
return list(self.iter_person_handles())
proxied = set(self.iter_person_handles())
all = self.basedb.get_person_handles(sort_handles=sort_handles)
return [hdl for hdl in all if str(hdl, 'utf-8') in proxied]
else:
return []
@ -331,9 +332,10 @@ class ProxyDbBase(DbReadBase):
Return a list of database handles, one handle for each Family in
the database. If sort_handles is True, the list is sorted by surnames
"""
# FIXME: this is not a sorted list of handles
if self.db.is_open:
return list(self.iter_family_handles())
proxied = set(self.iter_family_handles())
all = self.basedb.get_family_handles(sort_handles=sort_handles)
return [hdl for hdl in all if str(hdl, 'utf-8') in proxied]
else:
return []