DjangoDb: always force a gramps_id; typo fix
This commit is contained in:
parent
014f8e61f1
commit
b095c6b606
@ -1429,7 +1429,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
def add_person(self, person, trans, set_gid=True):
|
def add_person(self, person, trans, set_gid=True):
|
||||||
if not person.handle:
|
if not person.handle:
|
||||||
person.handle = create_id()
|
person.handle = create_id()
|
||||||
if not person.gramps_id and set_gid:
|
if not person.gramps_id:
|
||||||
person.gramps_id = self.find_next_person_gramps_id()
|
person.gramps_id = self.find_next_person_gramps_id()
|
||||||
self.commit_person(person, trans)
|
self.commit_person(person, trans)
|
||||||
return person.handle
|
return person.handle
|
||||||
@ -1437,7 +1437,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
def add_family(self, family, trans, set_gid=True):
|
def add_family(self, family, trans, set_gid=True):
|
||||||
if not family.handle:
|
if not family.handle:
|
||||||
family.handle = create_id()
|
family.handle = create_id()
|
||||||
if not family.gramps_id and set_gid:
|
if not family.gramps_id:
|
||||||
family.gramps_id = self.find_next_family_gramps_id()
|
family.gramps_id = self.find_next_family_gramps_id()
|
||||||
self.commit_family(family, trans)
|
self.commit_family(family, trans)
|
||||||
return family.handle
|
return family.handle
|
||||||
@ -1445,7 +1445,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
def add_citation(self, citation, trans, set_gid=True):
|
def add_citation(self, citation, trans, set_gid=True):
|
||||||
if not citation.handle:
|
if not citation.handle:
|
||||||
citation.handle = create_id()
|
citation.handle = create_id()
|
||||||
if not citation.gramps_id and set_gid:
|
if not citation.gramps_id:
|
||||||
citation.gramps_id = self.find_next_citation_gramps_id()
|
citation.gramps_id = self.find_next_citation_gramps_id()
|
||||||
self.commit_citation(citation, trans)
|
self.commit_citation(citation, trans)
|
||||||
return citation.handle
|
return citation.handle
|
||||||
@ -1453,7 +1453,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
def add_source(self, source, trans, set_gid=True):
|
def add_source(self, source, trans, set_gid=True):
|
||||||
if not source.handle:
|
if not source.handle:
|
||||||
source.handle = create_id()
|
source.handle = create_id()
|
||||||
if not source.gramps_id and set_gid:
|
if not source.gramps_id:
|
||||||
source.gramps_id = self.find_next_source_gramps_id()
|
source.gramps_id = self.find_next_source_gramps_id()
|
||||||
self.commit_source(source, trans)
|
self.commit_source(source, trans)
|
||||||
return source.handle
|
return source.handle
|
||||||
@ -1461,7 +1461,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
def add_repository(self, repository, trans, set_gid=True):
|
def add_repository(self, repository, trans, set_gid=True):
|
||||||
if not repository.handle:
|
if not repository.handle:
|
||||||
repository.handle = create_id()
|
repository.handle = create_id()
|
||||||
if not repository.gramps_id and set_gid:
|
if not repository.gramps_id:
|
||||||
repository.gramps_id = self.find_next_repository_gramps_id()
|
repository.gramps_id = self.find_next_repository_gramps_id()
|
||||||
self.commit_repository(repository, trans)
|
self.commit_repository(repository, trans)
|
||||||
return repository.handle
|
return repository.handle
|
||||||
@ -1469,7 +1469,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
def add_note(self, note, trans, set_gid=True):
|
def add_note(self, note, trans, set_gid=True):
|
||||||
if not note.handle:
|
if not note.handle:
|
||||||
note.handle = create_id()
|
note.handle = create_id()
|
||||||
if not note.gramps_id and set_gid:
|
if not note.gramps_id:
|
||||||
note.gramps_id = self.find_next_note_gramps_id()
|
note.gramps_id = self.find_next_note_gramps_id()
|
||||||
self.commit_note(note, trans)
|
self.commit_note(note, trans)
|
||||||
return note.handle
|
return note.handle
|
||||||
@ -1477,7 +1477,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
def add_place(self, place, trans, set_gid=True):
|
def add_place(self, place, trans, set_gid=True):
|
||||||
if not place.handle:
|
if not place.handle:
|
||||||
place.handle = create_id()
|
place.handle = create_id()
|
||||||
if not place.gramps_id and set_gid:
|
if not place.gramps_id:
|
||||||
place.gramps_id = self.find_next_place_gramps_id()
|
place.gramps_id = self.find_next_place_gramps_id()
|
||||||
self.commit_place(place, trans)
|
self.commit_place(place, trans)
|
||||||
return place.handle
|
return place.handle
|
||||||
@ -1485,7 +1485,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
def add_event(self, event, trans, set_gid=True):
|
def add_event(self, event, trans, set_gid=True):
|
||||||
if not event.handle:
|
if not event.handle:
|
||||||
event.handle = create_id()
|
event.handle = create_id()
|
||||||
if not event.gramps_id and set_gid:
|
if not event.gramps_id:
|
||||||
event.gramps_id = self.find_next_event_gramps_id()
|
event.gramps_id = self.find_next_event_gramps_id()
|
||||||
self.commit_event(event, trans)
|
self.commit_event(event, trans)
|
||||||
return event.handle
|
return event.handle
|
||||||
@ -1493,7 +1493,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
def add_tag(self, tag, trans):
|
def add_tag(self, tag, trans):
|
||||||
if not tag.handle:
|
if not tag.handle:
|
||||||
tag.handle = create_id()
|
tag.handle = create_id()
|
||||||
self.commit_event(tag, trans)
|
self.commit_tag(tag, trans)
|
||||||
return tag.handle
|
return tag.handle
|
||||||
|
|
||||||
def add_object(self, obj, transaction, set_gid=True):
|
def add_object(self, obj, transaction, set_gid=True):
|
||||||
@ -1505,7 +1505,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
"""
|
"""
|
||||||
if not obj.handle:
|
if not obj.handle:
|
||||||
obj.handle = create_id()
|
obj.handle = create_id()
|
||||||
if not obj.gramps_id and set_gid:
|
if not obj.gramps_id:
|
||||||
obj.gramps_id = self.find_next_object_gramps_id()
|
obj.gramps_id = self.find_next_object_gramps_id()
|
||||||
self.commit_media_object(obj, transaction)
|
self.commit_media_object(obj, transaction)
|
||||||
return obj.handle
|
return obj.handle
|
||||||
@ -1664,7 +1664,7 @@ class DbDjango(DbWriteBase, DbReadBase, UpdateCallback, Callback):
|
|||||||
else:
|
else:
|
||||||
self.emit("tag-add", ([tag.handle],))
|
self.emit("tag-add", ([tag.handle],))
|
||||||
|
|
||||||
def commit_media_object(self, media, transaction, change_time=None):
|
def commit_media_object(self, media, trans, change_time=None):
|
||||||
"""
|
"""
|
||||||
Commit the specified MediaObject to the database, storing the changes
|
Commit the specified MediaObject to the database, storing the changes
|
||||||
as part of the transaction.
|
as part of the transaction.
|
||||||
|
Loading…
Reference in New Issue
Block a user