diff --git a/src/webapp/libdjango.py b/src/webapp/libdjango.py index 22a31ad38..9da9fd163 100644 --- a/src/webapp/libdjango.py +++ b/src/webapp/libdjango.py @@ -1466,6 +1466,14 @@ class DjangoInterface(object): self.add_attribute_list(event, attribute_list) self.add_media_ref_list(event, media_list) self.add_citation_list(event, citation_list) + + def rebuild_cache(self, item): + if isinstance(item, models.Person): + raw = self.get_person(item) + item.cache = base64.encodestring(cPickle.dumps(raw)) + item.save() + else: + raise Exception("Don't know how to cache '%s'" % type(item)) def rebuild_caches(self, callback=None): """ diff --git a/src/webapp/shell.py b/src/webapp/shell.py index cf0b22278..b72c95e10 100644 --- a/src/webapp/shell.py +++ b/src/webapp/shell.py @@ -9,10 +9,11 @@ except RuntimeError: from webapp.grampsdb.models import * from webapp.dbdjango import DbDjango from webapp.reports import import_file +from webapp.libdjango import DjangoInterface db = DbDjango() +dji = DjangoInterface() -def Print(m): - print m - +#def Print(m): +# print m #import_file(db, "/tmp/dblank-im_ged.ged", Print)