def update(self, original, updates): updated = copy(original) updated.update(updates) updated['_id_document'] = original['_id'] del updated['_id'] try: return get_model(LegalArchiveModel).create([updated]) except Exception as e: get_component(Error).create(LegalArchiveModel.name(), [updated], str(e))
def create(self, items): citems = deepcopy(items) for citem in citems: citem['_id_document'] = citem['_id'] del citem['_id'] try: return get_model(LegalArchiveModel).create(citems) except Exception as e: get_component(Error).create(LegalArchiveModel.name(), items, str(e))