Beispiel #1
0
 def bulk_create(self, entity_list: List[dict]) -> List[MarkTask]:
     entity_list = [MarkTask(**entity) for entity in entity_list]
     session.bulk_save_objects(entity_list, return_defaults=True)
     session.flush()
     return entity_list
 def delete(self, _id):
     session.query(TrainM2mMark).filter(TrainM2mMark.id == _id).update(
         {TrainM2mMark.is_deleted: True})
     session.flush()
 def delete(self, _id):
     session.query(EvaluateTask).filter(EvaluateTask.evaluate_task_id == _id).update({EvaluateTask.is_deleted: True})
     session.flush()
 def bulk_delete(self, _id_list):
     session.query(CustomAlgorithm).filter(
         CustomAlgorithm.custom_algorithm_id.in_(_id_list)).update(
             {CustomAlgorithm.is_deleted: True})
     session.flush()
 def create(self, **kwargs) -> TrainM2mMark:
     entity = TrainM2mMark(**kwargs)
     session.add(entity)
     session.flush()
     return entity
 def bulk_update(self, entity_list):
     session.bulk_update_mappings(CustomAlgorithm, entity_list)
     session.flush()
 def bulk_create(self, entity_list):
     session.bulk_save_objects(entity_list, return_defaults=True)
     session.flush()
     return entity_list
Beispiel #8
0
 def create_classify_rule(**kwargs):
     entity = ClassifyDocRule(**kwargs)
     session.add(entity)
     session.flush()
     return entity
Beispiel #9
0
 def update(self, doc_term_id, **kwargs):
     q = session.query(DocTerm).filter(DocTerm.doc_term_id == doc_term_id)
     q.update(kwargs)
     session.flush()
     return q.one()
Beispiel #10
0
 def delete(self, _id):
     session.query(MarkJob).filter(MarkJob.mark_job_id == _id).update({MarkJob.is_deleted: True})
     session.query(MarkTask).filter(MarkTask.mark_job_id == _id).update({MarkTask.is_deleted: True})
     session.flush()
Beispiel #11
0
 def bulk_delete(self, _id_list):
     session.query(MarkJob).filter(
         MarkJob.mark_job_id.in_(_id_list)).update({MarkJob.is_deleted: True}, synchronize_session='fetch')
     session.query(MarkTask).filter(
         MarkTask.mark_job_id.in_(_id_list)).update({MarkTask.is_deleted: True}, synchronize_session='fetch')
     session.flush()
Beispiel #12
0
 def bulk_create(self, entity_list: List[MarkJob]) -> List[MarkJob]:
     session.bulk_save_objects(entity_list, return_defaults=True)
     session.flush()
     return entity_list
Beispiel #13
0
 def create(self, **kwargs):
     entity = MarkJob(**kwargs)
     session.add(entity)
     session.flush()
     return entity
Beispiel #14
0
 def update(self, _id, **kwargs):
     entity = session.query(MarkJob).filter(MarkJob.mark_job_id == _id)
     entity.update(kwargs)
     session.flush()
     return entity.one()
Beispiel #15
0
 def bulk_create(self, entity_list):
     entity_list = [ClassifyDocRule(**entity) for entity in entity_list]
     session.bulk_save_objects(entity_list, return_defaults=True)
     session.flush()
     return entity_list
Beispiel #16
0
 def bulk_update(self, entity_list):
     for e in entity_list:
         session.merge(DocTerm(**e))
     session.flush()
Beispiel #17
0
 def delete(self, _id):
     session.query(ClassifyDocRule).filter(ClassifyDocRule.classify_rule_id == _id)\
         .update({ClassifyDocRule.is_deleted: True})
     session.flush()
 def create(self, **kwargs) -> Doc:
     entity = Doc(**kwargs)
     session.add(entity)
     session.flush()
     return entity
 def create(self, **kwargs) -> CustomAlgorithm:
     entity = CustomAlgorithm(**kwargs)
     session.add(entity)
     session.flush()
     return entity
 def bulk_create(self, entity_list) -> typing.List[Doc]:
     entity_list = [Doc(**entity) for entity in entity_list]
     session.bulk_save_objects(entity_list, return_defaults=True)
     session.flush()
     return entity_list
 def delete(self, _id):
     session.query(CustomAlgorithm).filter(
         CustomAlgorithm.custom_algorithm_id == _id).update(
             {CustomAlgorithm.is_deleted: True})
     session.flush()
 def delete(self, _id):
     session.query(Doc).filter(Doc.doc_id == _id).update(
         {Doc.is_deleted: True})
     session.flush()
 def update(self, _id, **kwargs):
     entity = session.query(CustomAlgorithm).filter(
         CustomAlgorithm.custom_algorithm_id == _id)
     entity.update(kwargs)
     session.flush()
     return entity.one()
 def bulk_delete(self, _id_list):
     session.query(Doc).filter(Doc.doc_id.in_(_id_list)).update(
         {Doc.is_deleted: True})
     session.flush()
 def bulk_create(self, entity_list) -> [TrainM2mMark]:
     entity_list = [TrainM2mMark(**entity) for entity in entity_list]
     session.bulk_save_objects(entity_list, return_defaults=True)
     session.flush()
     return entity_list
 def update(self, _id, **kwargs):
     entity = session.query(Doc).filter(Doc.doc_id == _id)
     entity.update(kwargs)
     session.flush()
     return entity.one()
 def create(self, **kwargs) -> EvaluateTask:
     entity = EvaluateTask(**kwargs)
     session.add(entity)
     session.flush()
     return entity
Beispiel #28
0
 def create(self, **kwargs) -> ClassifyDocRule:
     entity = ClassifyDocRule(**kwargs)
     session.add(entity)
     session.flush()
     return entity
 def update(self, _id, **kwargs):
     entity = session.query(EvaluateTask).filter(EvaluateTask.evaluate_task_id == _id)
     entity.update(kwargs)
     session.flush()
     return entity.one()
Beispiel #30
0
 def create(self, **kwargs) -> MarkTask:
     entity = MarkTask(**kwargs)
     session.add(entity)
     session.flush()
     return entity