Example #1
0
 def delete(self):
     self.status = self.DELETE_STATUS
     try:
         db.session.commit()
     except Exception as e:
         log.exception(e)
         handelAbort(f"err:{str(e)}")
Example #2
0
 def Delete(self):
     try:
         db.session.delete(self)
         db.session.commit()
     except Exception as e:
         log.exception(e)
         db.session.rollback()
         handelAbort(f"err:{str(e)}")
Example #3
0
 def assertDo(self, do: str):
     if do not in DO:
         handelAbort(f"Parameter:{do} not support")
     return do
Example #4
0
 def assertName(cls, name):
     res = cls.query.filter_by(name=name).first()
     if res:
         handelAbort(f"已存在  {name}!")
Example #5
0
 def assertName(cls, name):
     res = cls.query.filter_by(name=name).first()
     if res:
         handelAbort("caseNamec存在")
Example #6
0
 def assertIdExisted(cls, id):
     p = cls.query.get_or_NoFound(id)
     if not p or p.status == 0:
         handelAbort("envId 不存在或删除")
     return p
Example #7
0
 def assertIdExisted(cls, id):
     p = cls.query.get(id)
     if not p or p.status == 0:
         handelAbort("interface 不存在或删除")
Example #8
0
 def assertName(cle, name):
     res = cle.query.filter_by(interface_name=name).first()
     if res:
         handelAbort("interface_name 重复!")
Example #9
0
 def assertName(cle, name):
     res = cle.query.filter_by(project_name=name, status=1).first()
     if res:
         handelAbort("projectName 重复!")
Example #10
0
 def assertIdExisted(cls, id):
     p = cls.query.get(id)
     if not p:
         handelAbort(f"projectId {id} 不存在或删除")
     return p