Need to upate cache and probably_alive after edit/import
svn: r18593
This commit is contained in:
parent
e3227d6374
commit
96bd83275e
@ -233,6 +233,8 @@ def view_name_detail(request, handle, order, action="view"):
|
|||||||
n = form.save()
|
n = form.save()
|
||||||
else:
|
else:
|
||||||
action = "edit"
|
action = "edit"
|
||||||
|
# FIXME: need to update cache
|
||||||
|
# FIXME: need to reset probabily_alive
|
||||||
context = RequestContext(request)
|
context = RequestContext(request)
|
||||||
context["action"] = action
|
context["action"] = action
|
||||||
context["tview"] = _('Name')
|
context["tview"] = _('Name')
|
||||||
|
@ -47,6 +47,7 @@ def import_file(db, filename, callback):
|
|||||||
|
|
||||||
>>> import_file(DbDjango(), "/home/user/Untitled_1.ged", lambda a: a)
|
>>> import_file(DbDjango(), "/home/user/Untitled_1.ged", lambda a: a)
|
||||||
"""
|
"""
|
||||||
|
from grampsdb.models import Person
|
||||||
dbstate = DbState.DbState()
|
dbstate = DbState.DbState()
|
||||||
climanager = CLIManager(dbstate, False) # do not load db_loader
|
climanager = CLIManager(dbstate, False) # do not load db_loader
|
||||||
climanager.do_reg_plugins(dbstate, None)
|
climanager.do_reg_plugins(dbstate, None)
|
||||||
@ -68,6 +69,10 @@ def import_file(db, filename, callback):
|
|||||||
db.prepare_import()
|
db.prepare_import()
|
||||||
import_function(db, filename, callback)
|
import_function(db, filename, callback)
|
||||||
db.commit_import()
|
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 True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user