Ejemplo n.º 1
0
def project_list():
    page=request.args.get('page',1)
    page_size=request.args.get('page_size',20)
    title=None
    if request.method=='POST':
        title=request.forms.get('title',None)
    (projects,paginate)=project_service.query_projects_by_page(title)
    return render_template('admins/project/project_list.html',projects=projects,paginate=paginate,title=u'项目管理',menu_project=True)
Ejemplo n.º 2
0
def projects_list():
    page=request.args.get('page',1)
    page_size=request.args.get('page_size',20)
    (items,paginate)=project_service.query_projects_by_page(page=page,page_size=page_size)

    data = {
        'title': u"项目列表",
        'active': 'projects',
        'projects':items,
        'paginate':paginate
    }


    return render_template("app/project/list.html",data = data)
Ejemplo n.º 3
0
def get_projects_by_page(result):
    data = request.get_json()

    page = data.get('page', 1)
    page_size = data.get('page_size', 20)
    is_recommend = data.get('is_recommend', None)
    status = data.get('status', None)
    order_by = data.get('order_by')
    if order_by == "update":
        order_by = 'updated_time desc'
    elif order_by == "create":
        order_by = "created_time desc"
    (projects, paginate) = project_service.query_projects_by_page(page=page, page_size=page_size, order_by=order_by,
                                                                  querys={"status": status,
                                                                          'is_recommend': is_recommend})

    arr = []
    for project in projects:
        arr.append(project.as_map())
    result['projects'] = arr