diff --git a/gramps/webapp/dbdjango.py b/gramps/webapp/dbdjango.py index 436e7d38b..bc13e4d04 100644 --- a/gramps/webapp/dbdjango.py +++ b/gramps/webapp/dbdjango.py @@ -266,7 +266,7 @@ class DbDjango(DbWriteBase, DbReadBase): self.use_import_cache = True self.import_cache = {} - @transaction.commit_on_success + @transaction.atomic def commit_import(self): """ Commits the items that were queued up during the last gedcom diff --git a/gramps/webapp/grampsdb/models.py b/gramps/webapp/grampsdb/models.py index adbadeaf2..9fe3263e1 100644 --- a/gramps/webapp/grampsdb/models.py +++ b/gramps/webapp/grampsdb/models.py @@ -439,10 +439,10 @@ class Tag(models.Model): if self.dji is None: self.dji = DjangoInterface() raw = self.dji.get_tag(self) - return base64.encodestring(pickle.dumps(raw)) + return base64.encodebytes(pickle.dumps(raw)) def from_cache(self): - return pickle.loads(base64.decodestring(self.cache)) + return pickle.loads(base64.decodebytes(bytes(self.cache, "utf-8"))) def save_cache(self): cache = self.make_cache() @@ -529,10 +529,10 @@ class PrimaryObject(models.Model): raw = self.dji.get_tag(self) else: raise Exception("Don't know how to get raw '%s'" % type(item)) - return base64.encodestring(pickle.dumps(raw)) + return base64.encodebytes(pickle.dumps(raw)) def from_cache(self): - return pickle.loads(base64.decodestring(self.cache)) + return pickle.loads(base64.decodebytes(bytes(self.cache, "utf-8"))) def save_cache(self): cache = self.make_cache() diff --git a/gramps/webapp/libdjango.py b/gramps/webapp/libdjango.py index 7d28b8935..19b5af551 100644 --- a/gramps/webapp/libdjango.py +++ b/gramps/webapp/libdjango.py @@ -454,7 +454,7 @@ class DjangoInterface(object): media.gramps_id, conv_to_unicode(media.path, None), str(media.mime), - fix_encoding(media.desc), + str(media.desc), media.checksum, attribute_list, citation_list, @@ -806,6 +806,9 @@ class DjangoInterface(object): for family_handle in family_list: self.add_family_ref(person, family_handle) + def add_alt_name_list(self, place, alt_name_list): + print("FIXME: add alt_name_list!", alt_name_list) + ## Export reference objects: def add_person_ref_default(self, obj, person, private=False, desc=None): @@ -1579,9 +1582,11 @@ class DjangoInterface(object): #obj.save() def add_place(self, data): + ## ('cef246c95c132bcf6a0255d4d17', 'P0036', 'Santa Clara Co., CA, USA', '', '', [('cef243fb5634559442323368f63', None)], 'Santa Clara Co.', [], (3, ''), '', [], [], [], [], [], 1422124781, [], False) (handle, gid, title, long, lat, place_ref_list, name, + alt_name_list, place_type, code, alt_location_list, @@ -1612,6 +1617,7 @@ class DjangoInterface(object): (handle, gid, title, long, lat, place_ref_list, name, + alt_name_list, place_type, code, alt_location_list, @@ -1635,6 +1641,7 @@ class DjangoInterface(object): self.add_note_list(place, note_list) self.add_tag_list(place, tag_list) self.add_place_ref_list(place, place_ref_list) + self.add_alt_name_list(place, alt_name_list) count = 1 for loc_data in alt_location_list: self.add_location("place", place, loc_data, count)