Need to upate cache and probably_alive after edit/import

svn: r18593
This commit is contained in:
Doug Blank 2011-12-13 14:23:13 +00:00
parent e3227d6374
commit 96bd83275e
2 changed files with 7 additions and 0 deletions

View File

@ -233,6 +233,8 @@ def view_name_detail(request, handle, order, action="view"):
n = form.save()
else:
action = "edit"
# FIXME: need to update cache
# FIXME: need to reset probabily_alive
context = RequestContext(request)
context["action"] = action
context["tview"] = _('Name')

View File

@ -47,6 +47,7 @@ def import_file(db, filename, callback):
>>> import_file(DbDjango(), "/home/user/Untitled_1.ged", lambda a: a)
"""
from grampsdb.models import Person
dbstate = DbState.DbState()
climanager = CLIManager(dbstate, False) # do not load db_loader
climanager.do_reg_plugins(dbstate, None)
@ -68,6 +69,10 @@ def import_file(db, filename, callback):
db.prepare_import()
import_function(db, filename, callback)
db.commit_import()
# FIXME: need to call probably_alive
for person in Person.objects.all():
person.probably_alive = not bool(person.death)
person.save()
return True
return False