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 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_create_projectversion(request): ''' create new db model projectversion ''' message = "successful" try: projectversion = ProjectVersion() projectversion = ProjectVersionService.initlize_dm_instance(request, projectversion) DAL_ProjectVersion.add_projectversion(projectversion) except Exception as ex: message = str(ex) return message
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_projectversion_version(projectversionid): result = "" if projectversionid != 0: projectversion = DAL_ProjectVersion.get_projectversion( projectversionid) result = projectversion.PVVersion return result
def vm_get_all_projects(request): try: pageindex = int(request.POST['pageindex']) projectid=request.POST["projectid"] result = DAL_ProjectVersion.get_all().filter(PVProjectID=int(projectid)) except Exception as ex: print(ex) return result[12 * (pageindex - 1):12 * pageindex]
def get_projectversion_pagecounts(request): pagecounts=1 try: pageindex = int(request.POST['pageindex']) projectid=request.POST["projectid"] result = DAL_ProjectVersion.get_all().filter(PVProjectID=int(projectid)) if len(result): pagecounts=len(result)/12+1 except Exception as ex: print(ex) return pagecounts
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 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 getsubmition_version(testsubmitionid, projectid): avalible_version = DAL_ProjectVersion.get_project_version(projectid) result = list() for version in avalible_version: temp = dict() temp["text"] = version.PVVersion temp["memberid"] = version.id if testsubmitionid != 0: testsubmition = DAL_TestSubmition.gettestsubmition( testsubmitionid) if int(testsubmition.TPSProductVersion) == version.id: 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