2006-05-19 Alex Roitman <shura@gramps-project.org>

* src/GrampsDb/_GrampsDbBase.py: Define methods to get custom types.
	* src/GrampsDb/_GrampsBSDDB.py: Load/save marker_types.



svn: r6721
This commit is contained in:
Alex Roitman 2006-05-19 17:32:23 +00:00
parent ea394fd4d2
commit 76ea8437ed
3 changed files with 45 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2006-05-19 Alex Roitman <shura@gramps-project.org>
* src/GrampsDb/_GrampsDbBase.py: Define methods to get custom types.
* src/GrampsDb/_GrampsBSDDB.py: Load/save marker_types.
2006-05-19 Don Allingham <don@gramps-project.org>
* src/RelLib/_SecondaryObject.py: added, provide is_equal
* src/RelLib/_Url.py: inherit from SecondaryObject

View File

@ -397,6 +397,7 @@ class GrampsBSDDB(GrampsDbBase):
self.individual_event_names = set(self.metadata.get('pevent_names',[]))
self.family_attributes = set(self.metadata.get('fattr_names',[]))
self.individual_attributes = set(self.metadata.get('pattr_names',[]))
self.marker_names = set(self.metadata.get('marker_names',[])
self.child_ref_types = set(self.metadata.get('child_refs',[]))
self.family_rel_types = set(self.metadata.get('family_rels',[]))
self.event_role_names = set(self.metadata.get('event_roles',[]))
@ -823,6 +824,7 @@ class GrampsBSDDB(GrampsDbBase):
self.metadata['pevent_names'] = list(self.individual_event_names)
self.metadata['fattr_names'] = list(self.family_attributes)
self.metadata['pattr_names'] = list(self.individual_attributes)
self.metadata['marker_names'] = list(self.marker_names)
self.metadata['child_refs'] = list(self.child_ref_types)
self.metadata['family_rels'] = list(self.family_rel_types)
self.metadata['event_roles'] = list(self.event_role_names)

View File

@ -538,13 +538,13 @@ class GrampsDbBase(GrampsDBCallback):
[str(attr.type) for attr in family.attribute_list
if attr.type.is_custom()])
self.child_ref_types.update(
[str(ref.frel) for ref in family.child_ref_list
if ref.frel.is_custom()])
self.child_ref_types.update(
[str(ref.mrel) for ref in family.child_ref_list
if ref.mrel.is_custom()])
rel_list = []
for ref in family.child_ref_list:
if ref.frel.is_custom():
rel_list.append(str(ref.frel))
if ref.mrel.is_custom():
rel_list.append(str(ref.mrel))
self.child_ref_types.update(rel_list)
self.event_role_names.update(
[str(eref.role) for eref in family.event_ref_list
@ -1629,12 +1629,43 @@ class GrampsDbBase(GrampsDBCallback):
def get_media_attribute_types(self):
"""returns a list of all Attribute types assocated with Media
instances in the database"""
# FIXME: THIS IS NOT STORED/DEFINED YET
return []
def get_family_relation_types(self):
"""returns a list of all relationship types assocated with Family
instances in the database"""
return []
return list(self.family_rel_types)
def get_child_reference_types(self):
"""returns a list of all child reference types assocated with Family
instances in the database"""
return list(self.child_ref_types)
def get_event_roles(self):
"""returns a list of all custom event role names assocated with Event
instances in the database"""
return list(self.event_role_names)
def get_name_types(self):
"""returns a list of all custom names types assocated with Person
instances in the database"""
return list(self.name_types)
def get_repository_types(self):
"""returns a list of all custom repository types assocated with
Repository instances in the database"""
return list(self.repository_types)
def get_source_media_types(self):
"""returns a list of all custom source media types assocated with
Source instances in the database"""
return list(self.source_media_types)
def get_url_types(self):
"""returns a list of all custom names types assocated with Url
instances in the database"""
return list(self.url_types)
def remove_person(self, handle, transaction):
"""
@ -2205,4 +2236,3 @@ class DbState(GrampsDBCallback):
self.active = None
self.open = False
self.emit('no-database')