def get(self, page=1): if current_user.is_sper == True: resylt = (Interface.query.filter_by( status=False).order_by('-id').all()) else: resylt = [] id = [] for pros in current_user.quanxians: if not (pros.projects.id in id): pagination = Interface.query.filter( Interface.projects_id == pros.projects.id, Interface.status == False).all() id.append(pros.projects.id) resylt.append(pagination) resylt = hebinglist(resylt) pager_obj = Pagination(request.args.get("page", 1), len(resylt), request.path, request.args, per_page_count=PageShow) index_list = resylt[pager_obj.start:pager_obj.end] html = pager_obj.page_html() return render_template('home/interface.html', inte=index_list, html=html)
def get(self,page=1): projecs,models=get_pro_mo() if current_user.is_sper == True: projects=Project.query.filter_by(status=False).order_by('-id').all() else: projects=[] id=[] for i in current_user.quanxians: if (i.projects in id)==False: projects.append(i.projects) id.append(i.projects) if current_user.is_sper==True: resylt=InterfaceTest.query.filter_by(status=False).order_by('-id').all() else: resylt =[] id=[] for projec in current_user.quanxians: if not (projec.projects.id in id): resylt.append(InterfaceTest.query.filter(InterfaceTest.projects_id==projec.projects.id,InterfaceTest.status==0).all()) id.append(projec.projects.id) resylt=hebinglist(resylt) pager_obj = Pagination(request.args.get("page", 1), len(resylt), request.path, request.args, per_page_count=PageShow) index_list = resylt[pager_obj.start:pager_obj.end] html = pager_obj.page_html() return render_template('home/interface_yongli.html',index_list=index_list, html = html,models=models,projects=projects)
def get(self): if current_user.is_sper == True: pagination=(User.query.filter_by(status=False).order_by('-id').all()) else: pagination=[] id=[] for projec in current_user.quanxians: if (projec.user.all() in id) is False: pagination.append(projec.user.all()) id.append(projec.user.all()) pagination=(hebinglist(pagination)) pager_obj = Pagination(request.args.get("page", 1), len(pagination), request.path, request.args, per_page_count=PageShow) index_list = pagination[pager_obj.start:pager_obj.end] html = pager_obj.page_html() return render_template('home/useradmin.html', users=index_list,html=html)
def dispatch_request(self): if current_user.is_sper == True: pagination = (TestResult.query.filter_by(status=False).all()) else: pagination = [] id = [] for projec in current_user.quanxians: if not (projec.projects.id in id): pagination.append( TestResult.query.filter_by( projects_id=projec.projects.id, status=False).all()) id.append(projec.projects.id) pagination = hebinglist(pagination) pager_obj = Pagination(request.args.get("page", 1), len(pagination), request.path, request.args, per_page_count=PageShow) index_list = pagination[pager_obj.start:pager_obj.end] html = pager_obj.page_html() return render_template('home/test_result.html', inte=index_list, html=html)