def get_projectversion_version(projectversionid): result = "" if projectversionid != 0: projectversion = DAL_ProjectVersion.get_projectversion( projectversionid) result = projectversion.PVVersion return result
def dm_delete_projectversion(request): message = "successful" try: projectversionid = request.POST["projectversionid"] print(projectversionid) projectversion = DAL_ProjectVersion.get_projectversion(projectversionid) projectversion.TPProjectIsActive=0 DAL_ProjectVersion.add_projectversion(projectversion) except Exception as ex: message = str(ex) return message
def dm_update_projectversion(request): message = "successful" try: projectversionid = request.POST["projectversionid"] projectversion = DAL_ProjectVersion.get_projectversion(projectversionid) projectversion = ProjectVersionService.initlize_dm_instance(request,projectversion) DAL_ProjectVersion.add_projectversion(projectversion) except Exception as ex: message = str(ex) print(message) return message
def get_project_version(testsubmition): try: if testsubmition.TPSProductVersion.isdigit(): projectversion=DAL_ProjectVersion.get_projectversion(int(testsubmition.TPSProductVersion)) if projectversion: return projectversion.PVVersion else: return testsubmition.TPSProductVersion else: return testsubmition.TPSProductVersion except Exception as ex: print(ex)
def dm_copy_projectversion(requestpost): message = "successful" try: projectversionid = requestpost["projectversionid"] projectversion = DAL_ProjectVersion.get_projectversion(projectversionid) # projectversion.TPSStatus = TestJobStatusEnum.JobStatus_NotSubmit projectversion.id=None projectversion.TPSSubmitTime=None DAL_ProjectVersion.add_projectversion(projectversion) except Exception as ex: message = str(ex) return message
def get_pm_emaillist(testsubmition, outputemaillist): emaillist = outputemaillist try: if testsubmition.TPSProductVersion.isdigit(): projectversion = DAL_ProjectVersion.get_projectversion( int(testsubmition.TPSProductVersion)) if projectversion: for userid in eval(projectversion.PVPM): user = UserService.getuser(userid) if user.email in emaillist: pass else: emaillist.append(user.email) except Exception as ex: print(ex) return emaillist
def get_projectversion_project(projectversionid): alltestprojects=DAL_TestProject.get_all() result=list() for project in alltestprojects: temp=dict() temp["text"]=project.TPName temp["memberid"]=project.id if projectversionid!=0: projectversion=DAL_ProjectVersion.get_projectversion(projectversionid) if project.id ==projectversion.PVProjectID: temp["selected"]=1 else: temp["selected"]=0 else: temp["selected"]=0 result.append(temp) return str(result).replace("u'","'")
def get_projectversion_pms(projectversionid): allusersList=[(user.id, user.last_name + user.first_name) for user in DAL_User.getallusers().order_by("id") if user.id>1] result=list() for user in allusersList: temp=dict() temp["text"]=user[1] temp["memberid"]=user[0] if projectversionid!=0: projectversion=DAL_ProjectVersion.get_projectversion(projectversionid) if user[0] in eval(projectversion.PVPM): temp["selected"]=1 else: temp["selected"]=0 else: temp["selected"]=0 result.append(temp) return str(result).replace("u'","'")
def get_qa_email_list(testsubmition, outputemaillist): emaillist = outputemaillist try: if testsubmition.TPSProductVersion.isdigit(): projectversion = DAL_ProjectVersion.get_projectversion( int(testsubmition.TPSProductVersion)) if projectversion: for testerid in eval(projectversion.PVTesters): tester = UserService.getuser(testerid) if tester.email in emaillist: pass else: emaillist.append(tester.email) else: emaillist = TestSubmitionService.getqaemaillist( testsubmition.TPSProductType, outputemaillist) except Exception as ex: print(ex) return emaillist