Ejemplo n.º 1
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
Ejemplo n.º 2
0
 def get_my_fortestings(request):
     my_project_ids = list()
     projects = ProjectService.get_projects_include_me(request).order_by(
         '-id')
     my_project_ids.extend([project.id for project in projects])
     result = ForTestingService.get_projects_fortestings(my_project_ids)
     return result
Ejemplo n.º 3
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)
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
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)
     
     
Ejemplo n.º 6
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 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
Ejemplo n.º 8
0
    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)
Ejemplo n.º 9
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
Ejemplo n.º 10
0
 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
 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
 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
Ejemplo n.º 13
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)
Ejemplo n.º 14
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)
Ejemplo n.º 15
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)
Ejemplo n.º 16
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
Ejemplo n.º 17
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
Ejemplo n.º 18
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)
Ejemplo n.º 19
0
 def get_queryset(self):
     qs = ProjectService.get_projects_include_me(self.request)
     return qs
Ejemplo n.º 20
0
 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)