def create_event(self, description=_("Estimated date"),
                  type=None, date=None, source=None,
                  note_text="", modifier=None):
     event = Event()
     event.set_description(description)
     note = Note()
     note.handle = create_id()
     note.type.set(NoteType.EVENT)
     note.set(note_text)
     self.db.add_note(note, self.trans)
     event.add_note(note.handle)
     if type:
         event.set_type(EventType(type))
     if date:
         if modifier:
             date.set_modifier(modifier)
         date.set_quality(Date.QUAL_ESTIMATED)
         date.set_yr_mon_day(date.get_year(), 0, 0)
         event.set_date_object(date)
     if source:
         citation = Citation()
         citation.set_reference_handle(source.get_handle())
         self.db.add_citation(citation, self.trans)
         event.add_citation(citation.get_handle())
         self.db.commit_source(source, self.trans)
     self.db.add_event(event, self.trans)
     return event
 def create_event(self, description=_("Estimated date"),
                  type=None, date=None, source=None,
                  note_text="", modifier=None):
     event = Event()
     event.set_description(description)
     note = Note()
     note.handle = create_id()
     note.type.set(NoteType.EVENT)
     note.set(note_text)
     self.db.add_note(note, self.trans)
     event.add_note(note.handle)
     if type:
         event.set_type(EventType(type))
     if date:
         if modifier:
             date.set_modifier(modifier)
         date.set_quality(Date.QUAL_ESTIMATED)
         date.set_yr_mon_day(date.get_year(), 0, 0)
         event.set_date_object(date)
     if source:
         citation = Citation()
         citation.set_reference_handle(source.get_handle())
         self.db.add_citation(citation, self.trans)
         event.add_citation(citation.get_handle())
         self.db.commit_source(source, self.trans)
     self.db.add_event(event, self.trans)
     return event
Esempio n. 3
0
 def create_event(self,type,desc=None,date=None,place=None,source=None):
     event = Event()
     if type:
         event.set_type(EventType(type))
     if desc:
         event.set_description(desc)
     if date:
         event.set_date_object(date)
     if place:
         event.set_place_handle(place.get_handle())
     if source:
         event.add_citation(source.get_handle())
     self.db.add_event(event,self.trans)
     self.db.commit_event(event,self.trans)
     return event
Esempio n. 4
0
 def create_event(self,type,desc=None,date=None,place=None,source=None):
     event = Event()
     if type:
         event.set_type(EventType(type))
     if desc:
         event.set_description(desc)
     if date:
         event.set_date_object(date)
     if place:
         event.set_place_handle(place.get_handle())
     if source:
         event.add_citation(source.get_handle())
     self.db.add_event(event,self.trans)
     self.db.commit_event(event,self.trans)
     return event