示例#1
0
 def get_project_fullpage(self,request,sub_nav_action):
     dm_projects=ProjectService.get_projects_include_me(request,sub_nav_action)
     dm_products=ProjectService.get_products_include_me(request)
     left_nav_bar=self.get_project_left_bar(request, sub_nav_action)
     sub_nav_bar=self.get_project_sub_nav_bar(request,dm_projects,sub_nav_action,dm_products)
     project_list=self.get_project_list_page(request,dm_projects)
     pagefileds={'left_nav_bar':left_nav_bar,"sub_nav_bar":"","project_list":project_list}
     return self.get_page(pagefileds,'project/home_project_index.html',request)
def delete(request, projectid):
    result = True
    try:
        ProjectService.delete_project(request, projectid)
    except Exception as ex:
        result = "删除失败,请联系管理员!"
        SimpleLogger.error(ex)
    return HttpResponse(result)
 def get_my_fortestings(request):
     my_project_ids = list()
     my_products = ProjectService.get_products_include_me(request).order_by('-id')
     for product in my_products:
         projects = ProjectService.get_projects_include_me(request, str(product.id)).order_by('-id')
         my_project_ids.extend([project.id for project in projects])
     result = ForTestingService.get_projects_fortestings(my_project_ids)
     return result
def create(request):
    result = True
    try:
        print(request.POST)
        ProjectService.create_project(request)
    except Exception as ex:
        result = "项目创建失败失败,请联系管理员"
        SimpleLogger.error(ex)
    return HttpResponse(result)
def edit(request, projectid):
    result = True
    try:
        print(request.POST)
        ProjectService.edit_project(request, projectid)
    except Exception as ex:
        result = "保存失败,请联系管理员"
        SimpleLogger.error(ex)
    return HttpResponse(result)
    def get_env_fullpage(self,request,sub_nav_action):
        dm_envs=ProjectService.get_projects_include_me(request,sub_nav_action)
        dm_products=ProjectService.get_products_include_me(request)
#         left_nav_bar=self.get_project_left_bar(request, sub_nav_action)
#         sub_nav_bar=self.get_project_sub_nav_bar(request,dm_projects,sub_nav_action,dm_products)
        list2=[i for i in range(6)]
        env_list=self.get_env_control(request,list2)
        pagefileds={'left_nav_bar':"","sub_nav_bar":"","web_appview":self.get_env_portal_webapp(env_list)}
        return self.get_page(pagefileds,ENVPortalPath.portal_index,request)
示例#7
0
 def all_my_tasks(request, filters, owner):
     my_project_ids = list()
     my_products = ProjectService.get_products_include_me(request).order_by(
         '-id')
     for product in my_products:
         projects = ProjectService.get_projects_include_me(
             request, str(product.id)).order_by('-id')
         my_project_ids.extend([project.id for project in projects])
     result = TaskService.project_all_tasks(owner, my_project_ids, filters)
     return result
 def get_queryset(self):
     show_extinfo = self.request.GET.get('extinfo',0)
     latest = self.request.GET.get('latest',0)
     my=self.request.GET.get('my',0)
     project_list = Project.objects.all()
     if str(my)=='1':
         project_list=ProjectService.get_projects_include_me(self.request)
         if str(latest) == '1':
             project_list=ProjectService.get_latest_projects_include_me(self.request)
     return project_list
示例#9
0
 def get_dashboard_index(self, request, sub_nav_action):
     dm_envs = ProjectService.get_projects_include_me(request)
     dm_products = ProjectService.get_products_include_me(request)
     left_nav_bar = self.get_dashboard_left_bar(request, sub_nav_action)
     list2 = [i for i in range(60)]
     env_list = ""
     pagefileds = {
         'left_nav_bar': left_nav_bar,
         "sub_nav_bar": "",
         "web_appview": self.get_dashboard_webapp(env_list)
     }
     return self.get_page(pagefileds, ENVDashBoardPath.dashboard_index,
                          request)
示例#10
0
 def get_project_fullpage(self, request, sub_nav_action):
     dm_projects = ProjectService.get_projects_include_me(request)
     dm_products = ProjectService.get_products_include_me(request)
     #         left_nav_bar=self.get_project_left_bar(request, sub_nav_action)
     #         sub_nav_bar=self.get_project_sub_nav_bar(request,dm_projects,sub_nav_action,dm_products)
     project_list = self.get_project_list_page(request, dm_projects)
     pagefileds = {
         'left_nav_bar': "",
         "sub_nav_bar": "",
         "project_list": project_list
     }
     return self.get_page(pagefileds, ProjectPortalPath.portal_index,
                          request)
示例#11
0
    def get_queryset(self):
        print(self.request.GET)
        show_extinfo = self.request.GET.get('extinfo',0)
        latest = self.request.GET.get('latest',0)
        my=self.request.GET.get('my',0)
        project_list = Project.objects.all()
        if str(my)=='1':
            project_list= ProjectService.get_projects_include_me(self.request)
            if str(latest) == '1':
                project_list=ProjectService.get_latest_projects_include_me(self.request)
        if str(show_extinfo) == "0":
            ProjectListView.serializer_class = project_serializer.ProjectSampleSerializer
        else:
            ProjectListView.serializer_class = project_serializer.ProjectSerializer

        return project_list
 def get_myproject_dropdown_list(self,request,selected_project_id):
     vm_projects=list()
     for dm_project in ProjectService.get_projects_include_me(request):
         tem_project=VM_Project(request.user.id,False,dm_project,selected_project_id)
         vm_projects.append(tem_project)
     pagefileds={"projects":vm_projects}
     return self.get_webpart(pagefileds,ProjectCommonControllPath.project_dropdown_list_path)
 def create(self, request, *args, **kwargs):
     project = ProjectService.create_project(request)
     serializer = project_serializer.ProjectSerializer(instance=project,data = request.data)
     serializer.is_valid(raise_exception=True)
     # self.perform_create(serializer)
     headers = self.get_success_headers(serializer.data)
     return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers)
示例#14
0
 def get_queryset(self):
     print(self.request.session.items())
     my_projects = ProjectService.get_projects_include_me(self.request)
     my_project_ids = [project.id for project in my_projects]
     all_my_activities = LogActionService.all_project_actions(
         my_project_ids)
     return all_my_activities
示例#15
0
 def get_products_include_me(request):
     my_projects=ProjectService.get_projects_include_me(request)
     prodcut_ids=list()
     for project in my_projects:
         if project.Product not in prodcut_ids:
             prodcut_ids.append(project.Product)
     return Product.objects.all().filter(id__in=prodcut_ids)
 def get_module_dropdown_list(self,project_id,selected_module_id):
     vm_modules=list()
     for dm_module in ProjectService.get_project_modules(project_id):
         tem_module=VM_ProjectModule(dm_module,selected_module_id)
         vm_modules.append(tem_module)
     pagefileds={"modules":vm_modules}
     return self.get_webpart(pagefileds,ProjectCommonControllPath.module_dropdown_list_path)
示例#17
0
 def get_env_menu(self,request,project_control_path):
     projects=list()
     for project in ProjectService.get_projects_include_me(request):
         projects.append(project)
     pagefileds={"projects":projects}
     return self.get_webpart(pagefileds,project_control_path)
     
     
 def get_portal_project_list(self, request):
     dm_projects = ProjectService.get_projects_include_me(request, None)
     projects = list()
     for project in dm_projects:
         if project != None:
             tem_project = VM_Project(request.user, False, project, 0)
             projects.append(tem_project)
     project_list_control = self.get_project_control(request, projects)
     return project_list_control
 def get_fortesting_summary(self, request):
     page_worker = ProjectForTestingPageWorker(request)
     project_ids = [
         project.id
         for project in ProjectService.get_projects_include_me(request)
     ]
     fortestings = ForTestingService.get_projects_fortestings(
         project_ids)[0:5]
     dashboard_fortesting_list = page_worker.get_fortesting_list_controll(
         True, False, fortestings)
     return dashboard_fortesting_list
 def get_project_activites(self, request, start_index):
     page_worker = ProjectDashBoardPageWorker(request)
     projectids = [
         project.id
         for project in ProjectService.get_projects_include_me(request)
     ]
     log_actions = LogActionService.all_project_actions(
         projectids)[start_index:(start_index + 20)]
     activity_webpart = page_worker.get_activity_webpart(
         log_actions, False, request.user)
     return activity_webpart
示例#21
0
 def get_full_page(self, request, sub_nav_action):
     project_ids = [
         project.id
         for project in ProjectService.get_projects_include_me(request)
     ]
     left_nav_bar = self.get_issue_left_bar(request, sub_nav_action)
     issue_webpart = self.get_issue_webpart(request, sub_nav_action)
     page_fileds = {
         'left_nav_bar': left_nav_bar,
         'issue_webpart': issue_webpart
     }
     return self.get_page(page_fileds, HomeIssuePath.home_issue_index,
                          request)
示例#22
0
 def get_product_ci_tasks(request,task_type,product_id):
     result = list()
     try:
         my_projects=ProjectService.get_projects_include_me(request)
         my_project_ids=[project.id for project in my_projects]
         if product_id.upper()=="ALL":
             if task_type!=0:
                 result=CITask.objects.all().filter(TaskType=task_type).filter(Project__in=my_project_ids).order_by('-LastHistory')
             else:
                 result=CITask.objects.all().filter(Project__in=my_project_ids).order_by('-LastHistory')
         else:
             product_projects=Project.objects.all().filter(Product=int(product_id)).filter(id__in=my_project_ids)
             result=CITask.objects.all().filter(Project__in=product_projects).filter(TaskType=task_type).order_by('-LastHistory')
     except Exception as ex:
         SimpleLogger.error(ex)
     return result
示例#23
0
 def get_full_page(self, request, sub_nav_action):
     project_ids = [
         project.id
         for project in ProjectService.get_projects_include_me(request)
     ]
     sub_leftnav = self.get_fortesting_sub_navbar(request, project_ids,
                                                  sub_nav_action)
     left_nav_bar = self.get_fortesting_left_bar(request, sub_nav_action)
     project_page_worker = ProjectForTestingPageWorker(request)
     fortestings = ForTestingService.get_projects_fortestings(project_ids)
     fortesting_list = project_page_worker.get_fortesting_list_page(
         True, False, fortestings)
     page_fileds = {
         'left_nav_bar': left_nav_bar,
         'sub_leftnav': "",
         'fortesting_list': fortesting_list
     }
     return self.get_page(page_fileds, 'fortesting/index.html', request)
示例#24
0
 def get_queryset(self):
     qs = ProjectService.get_projects_include_me(self.request)
     return qs
 def fortesting_count(self):
     my_projects = ProjectService.get_projects_include_me(self.request)
     my_project_ids = [project.id for project in my_projects]
     my_fortesting = ForTestingService.get_projects_fortestings(
         my_project_ids).filter(Status=2)
     return len(my_fortesting)
 def get_project_summary(self, request):
     page_worker = HomeProjectPageWorker(request)
     dm_projects = ProjectService.get_latest_projects(request)[0:8]
     dashboard_project_list = page_worker.get_home_dashboard_project_list(
         request, dm_projects)
     return dashboard_project_list