* src/DisplayModels.py (RepositoryModel): Display repository type as text

* src/RelLib.py (Repository): Serialize type as tuple not unicode


svn: r4767
This commit is contained in:
Martin Hawlisch 2005-06-03 10:02:50 +00:00
parent 8c624a2ba1
commit dce8f86240
3 changed files with 16 additions and 6 deletions

View File

@ -1,3 +1,7 @@
2005-06-03 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/DisplayModels.py (RepositoryModel): Display repository type as text
* src/RelLib.py (Repository): Serialize type as tuple not unicode
2005-06-02 Don Allingham <don@gramps-project.org> 2005-06-02 Don Allingham <don@gramps-project.org>
* src/DisplayModels.py: Handle EventRefs properly * src/DisplayModels.py: Handle EventRefs properly
* src/FamilyView.py: handle relationship types * src/FamilyView.py: handle relationship types

View File

@ -43,6 +43,8 @@ import gtk
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import NameDisplay import NameDisplay
import DateHandler import DateHandler
import RelLib
import Utils
_GENDER = [ _(u'female'), _(u'male'), _(u'unknown') ] _GENDER = [ _(u'female'), _(u'male'), _(u'unknown') ]
@ -541,7 +543,12 @@ class RepositoryModel(BaseModel):
return unicode(data[1]) return unicode(data[1])
def column_type(self,data): def column_type(self,data):
return unicode(data[2]) rtype = data[2]
if rtype[0] == RelLib.Event.CUSTOM or rtype[0] not in Utils.repository_types:
name = rtype[1]
else:
name = Utils.repository_types[rtype[0]]
return unicode(name)
def column_name(self,data): def column_name(self,data):
return unicode(data[3]) return unicode(data[3])
@ -597,4 +604,3 @@ class RepositoryModel(BaseModel):
def column_home_url(self,data): def column_home_url(self,data):
return unicode(data[7]) return unicode(data[7])

View File

@ -4416,7 +4416,7 @@ class Repository(PrimaryObject,NoteBase):
self.note = Note() self.note = Note()
def serialize(self): def serialize(self):
return (self.handle, self.gramps_id, unicode(self.type), return (self.handle, self.gramps_id, self.type,
unicode(self.name), self.address, unicode(self.name), self.address,
unicode(self.email), unicode(self.email),
unicode(self.search_url), unicode(self.home_url), unicode(self.search_url), unicode(self.home_url),