2006-08-17 Alex Roitman <shura@gramps-project.org>
* src/NameDisplay.py: Correct constants to accomodate Name change. * src/GrampsDb/_GrampsBSDDB.py: Upgrade the names. * src/RelLib/_Name.py: Remove sname attribute. svn: r7200
This commit is contained in:
parent
cd6ab43fc0
commit
655dc48a92
@ -1,3 +1,8 @@
|
||||
2006-08-17 Alex Roitman <shura@gramps-project.org>
|
||||
* src/NameDisplay.py: Correct constants to accomodate Name change.
|
||||
* src/GrampsDb/_GrampsBSDDB.py: Upgrade the names.
|
||||
* src/RelLib/_Name.py: Remove sname attribute.
|
||||
|
||||
2006-08-17 Don Allingham <don@gramps-project.org>
|
||||
* src/DataViews/_PersonView.py: apply filter to calcuated data before
|
||||
deleting a person from the list
|
||||
|
@ -1765,9 +1765,6 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
|
||||
event.source_list, event.note, witness_list,
|
||||
event.media_list, event.change) = info
|
||||
|
||||
if event.source_list != []:
|
||||
print [sr.serialize() for sr in event.source_list]
|
||||
|
||||
# Change ID if it is non-unique
|
||||
if event.gramps_id in dup_ids:
|
||||
max_id_number += 1
|
||||
@ -1936,7 +1933,7 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
|
||||
urls,lds_ord_list,source_list,note,change,marker,
|
||||
private,person_ref_list,) = info
|
||||
|
||||
new_info = (handle,gramps_id,gender,primary_name,alternate_names,
|
||||
new_info = (handle,gramps_id,gender,Name().serialize(),[],
|
||||
death_ref_index,birth_ref_index,[],
|
||||
family_list,parent_family_list,media_list,address_list,
|
||||
attribute_list,urls,lds_ord_list,source_list,note,
|
||||
@ -1944,7 +1941,13 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
|
||||
|
||||
person = Person()
|
||||
person.unserialize(new_info)
|
||||
|
||||
# Names lost the "sname" attribute
|
||||
person.primary_name.unserialize(convert_name_10(primary_name))
|
||||
person.alternate_names = [Name().unserialize(convert_name_10(name))
|
||||
for name in alternate_names]
|
||||
|
||||
# Events gained attribute_list
|
||||
for (privacy,note,ref,role) in event_ref_list:
|
||||
event_ref = EventRef()
|
||||
new_event_ref_data = (privacy,note,[],ref,role)
|
||||
@ -2147,6 +2150,12 @@ def _table_low_level_9(env,table):
|
||||
the_txn.commit()
|
||||
return (True,length)
|
||||
|
||||
def convert_name_10(name):
|
||||
# Names lost the "sname" attribute
|
||||
(privacy,source_list,note,date,first_name,surname,suffix,title,name_type,
|
||||
prefix,patronymic,sname,group_as,sort_as,display_as,call) = name
|
||||
return (privacy,source_list,note,date,first_name,surname,suffix,title,
|
||||
name_type,prefix,patronymic,group_as,sort_as,display_as,call)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
|
@ -51,11 +51,10 @@ _TITLE = 7
|
||||
_TYPE = 8
|
||||
_PREFIX = 9
|
||||
_PATRONYM = 10
|
||||
_SNAME = 11
|
||||
_GROUP = 12
|
||||
_SORT = 13
|
||||
_DISPLAY = 14
|
||||
_CALL = 15
|
||||
_GROUP = 11
|
||||
_SORT = 12
|
||||
_DISPLAY = 13
|
||||
_CALL = 14
|
||||
|
||||
_ACT = True
|
||||
_INA = False
|
||||
|
@ -67,7 +67,7 @@ class Name(SecondaryObject,PrivacyBase,SourceBase,NoteBase,DateBase):
|
||||
if data:
|
||||
(privacy,source_list,note,date,
|
||||
self.first_name,self.surname,self.suffix,self.title,
|
||||
name_type,self.prefix,self.patronymic,self.sname,
|
||||
name_type,self.prefix,self.patronymic,
|
||||
self.group_as,self.sort_as,self.display_as,self.call) = data
|
||||
self.type = NameType(name_type)
|
||||
PrivacyBase.unserialize(self,privacy)
|
||||
@ -86,7 +86,6 @@ class Name(SecondaryObject,PrivacyBase,SourceBase,NoteBase,DateBase):
|
||||
self.type = source.type
|
||||
self.prefix = source.prefix
|
||||
self.patronymic = source.patronymic
|
||||
self.sname = source.sname
|
||||
self.group_as = source.group_as
|
||||
self.sort_as = source.sort_as
|
||||
self.display_as = source.display_as
|
||||
@ -103,7 +102,6 @@ class Name(SecondaryObject,PrivacyBase,SourceBase,NoteBase,DateBase):
|
||||
self.type = NameType()
|
||||
self.prefix = ""
|
||||
self.patronymic = ""
|
||||
self.sname = '@'
|
||||
self.group_as = ""
|
||||
self.sort_as = self.DEF
|
||||
self.display_as = self.DEF
|
||||
@ -115,13 +113,13 @@ class Name(SecondaryObject,PrivacyBase,SourceBase,NoteBase,DateBase):
|
||||
NoteBase.serialize(self),
|
||||
DateBase.serialize(self),
|
||||
self.first_name,self.surname,self.suffix,self.title,
|
||||
self.type.serialize(),self.prefix,self.patronymic,self.sname,
|
||||
self.type.serialize(),self.prefix,self.patronymic,
|
||||
self.group_as,self.sort_as,self.display_as,self.call)
|
||||
|
||||
def unserialize(self,data):
|
||||
(privacy,source_list,note,date,
|
||||
self.first_name,self.surname,self.suffix,self.title,
|
||||
name_type,self.prefix,self.patronymic,self.sname,
|
||||
name_type,self.prefix,self.patronymic,
|
||||
self.group_as,self.sort_as,self.display_as,self.call) = data
|
||||
self.type.unserialize(name_type)
|
||||
PrivacyBase.unserialize(self,privacy)
|
||||
|
Loading…
Reference in New Issue
Block a user