File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 186
186
<column >
187
187
<_attribute >Occupation</_attribute >
188
188
<size >25</size >
189
+ <action title =' Create Occupation event' >
190
+ <enable_if >
191
+ <![CDATA[
192
+ True
193
+ ]]>
194
+ </enable_if >
195
+ <command >
196
+ <![CDATA[
197
+ # build the new OCCUPATION event
198
+ event = Event()
199
+ event.set_type(EventType.OCCUPATION)
200
+ event.set_date_object(self.event.get_date_object())
201
+ event.add_citation(self.citation.get_handle())
202
+ event.set_description(value)
203
+ with DbTxn("form_action", self.db) as trans:
204
+ # add to the database
205
+ self.db.add_event(event, trans)
206
+ # Add new event reference to the Person record
207
+ event_ref = EventRef()
208
+ event_ref.ref = event.get_handle()
209
+ event_ref.set_role(EventRoleType.PRIMARY)
210
+ person = self.db.get_person_from_handle(object)
211
+ person.add_event_ref(event_ref)
212
+ self.db.commit_person(person, trans)
213
+ ]]>
214
+ </command >
215
+ </action >
189
216
</column >
190
217
<column >
191
218
<_attribute >Where Born</_attribute >
You can’t perform that action at this time.
0 commit comments