add/delete families better

svn: r6124
This commit is contained in:
Don Allingham
2006-03-09 22:37:19 +00:00
parent 5ea057e8e6
commit e7f06df78e
6 changed files with 55 additions and 41 deletions

View File

@@ -525,22 +525,21 @@ class PersonView(PageView.PersonNavView):
def person_removed(self,handle_list):
self.model.clear_cache()
self.build_tree()
# for node in handle_list:
# person = self.dbstate.db.get_person_from_handle(node)
# top = person.get_primary_name().get_group_name()
# mylist = self.model.sname_sub.get(top,[])
# self.model.calculate_data()
# if mylist:
# try:
# path = self.model.on_get_path(node)
# self.model.row_deleted(path)
# if len(mylist) == 1:
# path = self.model.on_get_path(top)
# self.model.row_deleted(path)
# except KeyError:
# pass
# self.model.assign_data()
for node in handle_list:
person = self.dbstate.db.get_person_from_handle(node)
top = person.get_primary_name().get_group_name()
mylist = self.model.sname_sub.get(top,[])
self.model.calculate_data(skip=set(handle_list))
if mylist:
try:
path = self.model.on_get_path(node)
self.model.row_deleted(path)
if len(mylist) == 1:
path = self.model.on_get_path(top)
self.model.row_deleted(path)
except KeyError:
pass
self.model.assign_data()
def person_updated(self,handle_list):
self.model.clear_cache()