예제 #1
0
파일: views.py 프로젝트: baoliang/farm
def index():
    '''
    @todo:index page:
    '''
    pages = get_query_page(
        session.get('page', None),
        get_query(request.values, session.get('boot_time', now())),
        session.get('sid'),
        'news'
    )
    return_html = "index.html"
    if request.values.get("ajax", None): 
        return_html = "news/list.html"
    session.update(set_page_session(request.url, pages))
    return render_template(
        return_html,
        pages=pages,
        search_value=request.args.get('title','')
    ) 
예제 #2
0
파일: views.py 프로젝트: baoliang/farm
def buy_index():
    pages = get_query_page(
        session.get('page', None),
        get_query(request.values, session.get('boot_time', now())),
        session.get('sid'),
        'buy'
    )
    return_html = "buy/index.html"
    if request.values.get("ajax", None): 
        return_html = "buy/list.html"

    session.update(set_page_session(request.url, pages))
    return render_template(
        return_html,
        pages = pages,
        provice_list = get_info_list("city", query={'f_id': "0"}, return_type = "list", sort=1),
        city_list = get_info_list("city", query={'f_id': "35"}, return_type = "list", sort=1),
        search_value=request.args.get('title','')
        
    )