* src/GrampsDb/_GrampsDbBase.py (find_backlink_handles): Correctly
loop over all primary classes looking for a given handle. * src/RelLib/_Source.py (serialize, unserialize): properly save and restore marker. * src/RelLib/_MediaObject.py (serialize, unserialize): properly save and restore marker. * src/RelLib/_Place.py (serialize, unserialize): properly save and restore marker. * src/RelLib/_Repository.py (serialize, unserialize): properly save and restore marker. * src/RelLib/_Event.py (serialize, unserialize): properly save and restore marker. svn: r6507
This commit is contained in:
parent
41761b960d
commit
3b3197d702
@ -5,6 +5,18 @@
|
|||||||
expand and collapse all node menu entries
|
expand and collapse all node menu entries
|
||||||
|
|
||||||
2006-05-01 Alex Roitman <shura@gramps-project.org>
|
2006-05-01 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/GrampsDb/_GrampsDbBase.py (find_backlink_handles): Correctly
|
||||||
|
loop over all primary classes looking for a given handle.
|
||||||
|
* src/RelLib/_Source.py (serialize, unserialize): properly save
|
||||||
|
and restore marker.
|
||||||
|
* src/RelLib/_MediaObject.py (serialize, unserialize): properly
|
||||||
|
save and restore marker.
|
||||||
|
* src/RelLib/_Place.py (serialize, unserialize): properly save and
|
||||||
|
restore marker.
|
||||||
|
* src/RelLib/_Repository.py (serialize, unserialize): properly
|
||||||
|
save and restore marker.
|
||||||
|
* src/RelLib/_Event.py (serialize, unserialize): properly save and
|
||||||
|
restore marker.
|
||||||
* various: merge changes from gramps20.
|
* various: merge changes from gramps20.
|
||||||
|
|
||||||
2006-04-30 Alex Roitman <shura@gramps-project.org>
|
2006-04-30 Alex Roitman <shura@gramps-project.org>
|
||||||
|
@ -1905,26 +1905,28 @@ class GrampsDbBase(GrampsDBCallback):
|
|||||||
|
|
||||||
|
|
||||||
# Now we use the functions and classes defined above to loop through
|
# Now we use the functions and classes defined above to loop through
|
||||||
# each of the primary object tables that have been requests in the
|
# each of the existing primary object tables
|
||||||
#include_classes list.
|
|
||||||
for primary_table_name in primary_tables.keys():
|
for primary_table_name in primary_tables.keys():
|
||||||
|
cursor = primary_tables[primary_table_name]['cursor_func']()
|
||||||
if include_classes == None or primary_table_name in include_classes:
|
data = cursor.first()
|
||||||
|
|
||||||
cursor = primary_tables[primary_table_name]['cursor_func']()
|
|
||||||
data = cursor.first()
|
|
||||||
|
|
||||||
# Grap the real object class here so that the lookup does
|
# Grab the real object class here so that the lookup does
|
||||||
# not happen inside the main loop.
|
# not happen inside the main loop.
|
||||||
class_func = primary_tables[primary_table_name]['class_func']
|
class_func = primary_tables[primary_table_name]['class_func']
|
||||||
|
|
||||||
|
while data:
|
||||||
|
found_handle, val = data
|
||||||
|
obj = class_func()
|
||||||
|
obj.unserialize(val)
|
||||||
|
|
||||||
|
# Now we need to loop over all object types
|
||||||
|
# that have been requests in the include_classes list
|
||||||
|
for classname in primary_tables.keys():
|
||||||
|
if (include_classes == None) \
|
||||||
|
or (classname in include_classes):
|
||||||
|
|
||||||
while data:
|
if obj.has_handle_reference(classname,handle):
|
||||||
found_handle, val = data
|
yield (primary_table_name, found_handle)
|
||||||
obj = class_func()
|
|
||||||
obj.unserialize(val)
|
|
||||||
|
|
||||||
if obj.has_source_reference(handle):
|
|
||||||
yield (primary_table_name, found_handle)
|
|
||||||
|
|
||||||
data = cursor.next()
|
data = cursor.next()
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ class Event(PrimaryObject,SourceBase,NoteBase,MediaBase,DateBase,PlaceBase):
|
|||||||
SourceBase.serialize(self),
|
SourceBase.serialize(self),
|
||||||
NoteBase.serialize(self),
|
NoteBase.serialize(self),
|
||||||
MediaBase.serialize(self),
|
MediaBase.serialize(self),
|
||||||
self.change, self.marker, self.private)
|
self.change, self.marker.serialize(), self.private)
|
||||||
|
|
||||||
def unserialize(self,data):
|
def unserialize(self,data):
|
||||||
"""
|
"""
|
||||||
@ -118,8 +118,9 @@ class Event(PrimaryObject,SourceBase,NoteBase,MediaBase,DateBase,PlaceBase):
|
|||||||
(self.handle, self.gramps_id, the_type, date,
|
(self.handle, self.gramps_id, the_type, date,
|
||||||
self.description, self.place, self.cause,
|
self.description, self.place, self.cause,
|
||||||
source_list, note, media_list,
|
source_list, note, media_list,
|
||||||
self.change, self.marker, self.private) = data
|
self.change, marker, self.private) = data
|
||||||
|
|
||||||
|
self.marker.unserialize(marker)
|
||||||
self.type.unserialize(the_type)
|
self.type.unserialize(the_type)
|
||||||
DateBase.unserialize(self,date)
|
DateBase.unserialize(self,date)
|
||||||
MediaBase.unserialize(self,media_list)
|
MediaBase.unserialize(self,media_list)
|
||||||
|
@ -101,7 +101,9 @@ class MediaObject(PrimaryObject,SourceBase,NoteBase,DateBase,AttributeBase):
|
|||||||
SourceBase.serialize(self),
|
SourceBase.serialize(self),
|
||||||
NoteBase.serialize(self),
|
NoteBase.serialize(self),
|
||||||
self.change,
|
self.change,
|
||||||
DateBase.serialize(self), self.marker, self.private)
|
DateBase.serialize(self),
|
||||||
|
self.marker.serialize(),
|
||||||
|
self.private)
|
||||||
|
|
||||||
def unserialize(self,data):
|
def unserialize(self,data):
|
||||||
"""
|
"""
|
||||||
@ -113,8 +115,9 @@ class MediaObject(PrimaryObject,SourceBase,NoteBase,DateBase,AttributeBase):
|
|||||||
"""
|
"""
|
||||||
(self.handle, self.gramps_id, self.path, self.mime, self.desc,
|
(self.handle, self.gramps_id, self.path, self.mime, self.desc,
|
||||||
attribute_list, source_list, note, self.change,
|
attribute_list, source_list, note, self.change,
|
||||||
date, self.marker, self.private) = data
|
date, marker, self.private) = data
|
||||||
|
|
||||||
|
self.marker.unserialize(marker)
|
||||||
AttributeBase.unserialize(self,attribute_list)
|
AttributeBase.unserialize(self,attribute_list)
|
||||||
SourceBase.unserialize(self,source_list)
|
SourceBase.unserialize(self,source_list)
|
||||||
NoteBase.unserialize(self,note)
|
NoteBase.unserialize(self,note)
|
||||||
|
@ -100,7 +100,7 @@ class Place(PrimaryObject,SourceBase,NoteBase,MediaBase,UrlBase):
|
|||||||
MediaBase.serialize(self),
|
MediaBase.serialize(self),
|
||||||
SourceBase.serialize(self),
|
SourceBase.serialize(self),
|
||||||
NoteBase.serialize(self),
|
NoteBase.serialize(self),
|
||||||
self.change, self.marker,self.private)
|
self.change, self.marker.serialize() ,self.private)
|
||||||
|
|
||||||
def unserialize(self,data):
|
def unserialize(self,data):
|
||||||
"""
|
"""
|
||||||
@ -113,13 +113,14 @@ class Place(PrimaryObject,SourceBase,NoteBase,MediaBase,UrlBase):
|
|||||||
"""
|
"""
|
||||||
(self.handle, self.gramps_id, self.title, self.long, self.lat,
|
(self.handle, self.gramps_id, self.title, self.long, self.lat,
|
||||||
main_loc, alt_loc, urls, media_list, source_list, note,
|
main_loc, alt_loc, urls, media_list, source_list, note,
|
||||||
self.change, self.marker, self.private) = data
|
self.change, marker, self.private) = data
|
||||||
|
|
||||||
if main_loc == None:
|
if main_loc == None:
|
||||||
self.main_loc = None
|
self.main_loc = None
|
||||||
else:
|
else:
|
||||||
self.main_loc = Location().unserialize(main_loc)
|
self.main_loc = Location().unserialize(main_loc)
|
||||||
self.alt_loc = [Location().unserialize(al) for al in alt_loc]
|
self.alt_loc = [Location().unserialize(al) for al in alt_loc]
|
||||||
|
self.marker.unserialize(marker)
|
||||||
UrlBase.unserialize(self,urls)
|
UrlBase.unserialize(self,urls)
|
||||||
MediaBase.unserialize(self,media_list)
|
MediaBase.unserialize(self,media_list)
|
||||||
SourceBase.unserialize(self,source_list)
|
SourceBase.unserialize(self,source_list)
|
||||||
|
@ -65,7 +65,7 @@ class Repository(PrimaryObject,NoteBase,AddressBase,UrlBase):
|
|||||||
NoteBase.serialize(self),
|
NoteBase.serialize(self),
|
||||||
AddressBase.serialize(self),
|
AddressBase.serialize(self),
|
||||||
UrlBase.serialize(self),
|
UrlBase.serialize(self),
|
||||||
self.marker, self.private)
|
self.marker.serialize(), self.private)
|
||||||
|
|
||||||
def unserialize(self,data):
|
def unserialize(self,data):
|
||||||
"""
|
"""
|
||||||
@ -73,8 +73,9 @@ class Repository(PrimaryObject,NoteBase,AddressBase,UrlBase):
|
|||||||
back into the data in an Repository structure.
|
back into the data in an Repository structure.
|
||||||
"""
|
"""
|
||||||
(self.handle, self.gramps_id, the_type, self.name, note,
|
(self.handle, self.gramps_id, the_type, self.name, note,
|
||||||
address_list, urls ,self.marker, self.private) = data
|
address_list, urls, marker, self.private) = data
|
||||||
|
|
||||||
|
self.marker.unserialize(marker)
|
||||||
self.type.unserialize(the_type)
|
self.type.unserialize(the_type)
|
||||||
NoteBase.unserialize(self,note)
|
NoteBase.unserialize(self,note)
|
||||||
AddressBase.unserialize(self,address_list)
|
AddressBase.unserialize(self,address_list)
|
||||||
|
@ -63,7 +63,7 @@ class Source(PrimaryObject,MediaBase,NoteBase):
|
|||||||
MediaBase.serialize(self), unicode(self.abbrev),
|
MediaBase.serialize(self), unicode(self.abbrev),
|
||||||
self.change,self.datamap,
|
self.change,self.datamap,
|
||||||
[rr.serialize() for rr in self.reporef_list],
|
[rr.serialize() for rr in self.reporef_list],
|
||||||
self.marker,self.private)
|
self.marker.serialize(),self.private)
|
||||||
|
|
||||||
def unserialize(self,data):
|
def unserialize(self,data):
|
||||||
"""
|
"""
|
||||||
@ -73,8 +73,9 @@ class Source(PrimaryObject,MediaBase,NoteBase):
|
|||||||
(self.handle, self.gramps_id, self.title, self.author,
|
(self.handle, self.gramps_id, self.title, self.author,
|
||||||
self.pubinfo, note, media_list,
|
self.pubinfo, note, media_list,
|
||||||
self.abbrev, self.change, self.datamap, reporef_list,
|
self.abbrev, self.change, self.datamap, reporef_list,
|
||||||
self.marker, self.private) = data
|
marker, self.private) = data
|
||||||
|
|
||||||
|
self.marker.unserialize(marker)
|
||||||
NoteBase.unserialize(self,note)
|
NoteBase.unserialize(self,note)
|
||||||
MediaBase.unserialize(self,media_list)
|
MediaBase.unserialize(self,media_list)
|
||||||
self.reporef_list = [RepoRef().unserialize(rr) for rr in reporef_list]
|
self.reporef_list = [RepoRef().unserialize(rr) for rr in reporef_list]
|
||||||
|
Loading…
Reference in New Issue
Block a user