示例#1
0
def products(request,category_code,list_per_page,page_index):
    form=SearchForm(action='/search_post')
    data=Moshimo.get_by_category(category_code,list_per_page,page_index)
    data['categories']=Moshimo.get_category_name(category_code)
    data['form']=form.as_widget()

    return render_to_response('core/product_list.html',data)
示例#2
0
def search(request,words,list_per_page,page_index):
    form=SearchForm(action=url_for('core/search_post'))
    data=Moshimo.get_by_search_word(words,list_per_page,page_index)
    data['categories']=[u'検索',words]
    data['form']=form.as_widget()

    return render_to_response('core/product_list.html', data)
示例#3
0
def tags(request,tags,list_per_page,page_index):
    form=SearchForm(action='/search_post')
    data=Moshimo.get_by_tags(tags,list_per_page,page_index)
    data['categories']=[u'タグ',tags]
    data['form']=form.as_widget()

    return render_to_response('core/product_list.html',data)
示例#4
0
def detail(request,article_id):
    from core.models import Product
    form=SearchForm(action='/search_post')
    data=Moshimo.get_by_article_id(article_id)
    data['form']=form.as_widget()

    return render_to_response('core/detail.html', data)
示例#5
0
def index(request):
    u"""
    トップページ
    新入荷商品:Moshimo.get_new_item
    ヒット商品:Moshimo.get_sales_item
    """
    from moshimo import Moshimo
    from core.forms import SearchForm
    from kay.utils import render_to_response

    form=SearchForm(action='/search_post')
    salesitem_data=Moshimo.get_sales_item()
    newitem_data=Moshimo.get_new_item()

    return render_to_response('core/index.html', {
        'form':form.as_widget(),
        'newitem':newitem_data,
        'salesitem':salesitem_data,
    })