def _clone_person_links(self, new_event): attrs = get_simple_column_attrs(EventPersonLink) for old_link in self.old_event.person_links: link = EventPersonLink() link.populate_from_attrs(old_link, attrs) link.person = self._person_map[old_link.person] new_event.person_links.append(link)
def _copy_person_link_data(link_data): # Copy person link data since we would otherwise end up # adding the EventPersons of the first event in all other # events of the series. for link, submitter in link_data.iteritems(): link_copy = EventPersonLink(**{col: getattr(link, col) for col in get_simple_column_attrs(EventPersonLink)}) link_copy.person = EventPerson(**{col: getattr(link.person, col) for col in get_simple_column_attrs(EventPerson)}) yield link_copy, submitter
def _copy_person_link_data(link_data): # Copy person link data since we would otherwise end up # adding the EventPersons of the first event in all other # events of the series. for link, submitter in link_data.items(): link_copy = EventPersonLink(**{col: getattr(link, col) for col in get_simple_column_attrs(EventPersonLink)}) link_copy.person = EventPerson(**{col: getattr(link.person, col) for col in get_simple_column_attrs(EventPerson)}) link_copy.person.user = link.person.user yield link_copy, submitter