def _update_model(tran, model): if model.collection_name() not in tran['update']: tran['update'][model.collection_name()] = [] tran['update'][model.collection_name()].append(model)
def _delete_model(tran, model): if model.collection not in tran['del']: tran['del'][model.collection_name()] = [] tran['del'][model.collection_name()].append(model.id)
def _insert_model(tran, model): if model.collection_name() not in tran['new']: tran['new'][model.collection_name()] = [] tran['new'][model.collection_name()].append(model)