Event date handling fixes, and setting a photo list added

svn: r485
This commit is contained in:
Don Allingham 2001-10-19 00:12:54 +00:00
parent 039d897927
commit dd71b30a08

View File

@ -213,6 +213,10 @@ class Place(SourceNote):
"""Returns the list of Photo objects""" """Returns the list of Photo objects"""
return self.photoList return self.photoList
def setPhotoList(self,list):
"""Sets the list of Photo objects"""
self.photoList = list
class Researcher: class Researcher:
"""Contains the information about the owner of the database""" """Contains the information about the owner of the database"""
@ -839,6 +843,10 @@ class Person:
"""returns the list of Photos""" """returns the list of Photos"""
return self.photoList return self.photoList
def setPhotoList(self,list):
"""Sets the list of Photo objects"""
self.photoList = list
def addEvent(self,event): def addEvent(self,event):
"""adds an Event to the event list""" """adds an Event to the event list"""
self.EventList.append(event) self.EventList.append(event)
@ -991,7 +999,7 @@ class Event(DataObj):
self.cause = source.cause self.cause = source.cause
else: else:
self.place = None self.place = None
self.date = Date() self.date = None
self.description = "" self.description = ""
self.name = "" self.name = ""
self.cause = "" self.cause = ""
@ -1072,24 +1080,34 @@ class Event(DataObj):
def setDate(self, date) : def setDate(self, date) :
"""attempts to sets the date of the Event instance""" """attempts to sets the date of the Event instance"""
self.date.set(date) if not self.date:
self.date = Date()
self.date.set(date)
def getDate(self) : def getDate(self) :
"""returns a string representation of the date of the Event instance""" """returns a string representation of the date of the Event instance"""
return self.date.getDate() if self.date:
return self.date.getDate()
return ""
def getQuoteDate(self) : def getQuoteDate(self) :
"""returns a string representation of the date of the Event instance, """returns a string representation of the date of the Event instance,
enclosing the results in quotes if it is not a valid date""" enclosing the results in quotes if it is not a valid date"""
return self.date.getQuoteDate() if self.date:
return self.date.getQuoteDate()
return ""
def getDateObj(self): def getDateObj(self):
"""returns the Date object associated with the Event""" """returns the Date object associated with the Event"""
if not self.date:
self.date = Date()
return self.date return self.date
def getSaveDate(self) : def getSaveDate(self) :
"""returns the date of the Event in the form wanted by gramps XML save""" """returns the date of the Event in the form wanted by gramps XML save"""
return self.date.getSaveDate() if not self.date:
return self.date.getSaveDate()
return ""
class Family: class Family:
"""Represents a family unit in the gramps database""" """Represents a family unit in the gramps database"""
@ -1245,6 +1263,10 @@ class Family:
"""Returns the list of Photo objects""" """Returns the list of Photo objects"""
return self.photoList return self.photoList
def setPhotoList(self,list):
"""Sets the list of Photo objects"""
self.photoList = list
class Source: class Source:
"""A record of a source of information""" """A record of a source of information"""
@ -1274,6 +1296,10 @@ class Source:
"""Returns the list of Photo objects""" """Returns the list of Photo objects"""
return self.photoList return self.photoList
def setPhotoList(self,list):
"""Sets the list of Photo objects"""
self.photoList = list
def setTitle(self,title): def setTitle(self,title):
"""sets the title of the Source""" """sets the title of the Source"""
self.title = title self.title = title