Exemple #1
0
def base(request):
    pages = Page.objects.all().order_by('content_model').reverse()
    content_pages = pages.filter(content_model='richtextpage')
    form_page = pages.get(content_model='form').form
    blog_posts = BlogPost.objects.all()

    # if request.method == 'POST':
    return direct_to_template(request, "index.html",{"pages":pages, "content_pages":content_pages, "form_page":form_page, "blog_posts":blog_posts})
Exemple #2
0
def index_shop(request):
    """
    Context for index page
    """
    products = Product.objects.published().order_by(
        '-rating_sum').distinct()[:10]
    template = "index.html"
    extra_context = {"products": products}
    return direct_to_template(
        request, template=template, extra_context=extra_context)
Exemple #3
0
def order_payments(request, order_id):
    order = get_object_or_404(Order, pk=order_id)
    if request.user.id == order.user_id:
        robo_form = RobokassaForm(initial={
            'OutSum': order.total,
            'InvId': order.id,
            'Desc': order.additional_instructions,
            'Email': order.billing_detail_email,
            # 'IncCurrLabel': '',
            # 'Culture': 'ru'
        })
        template = "shop/payment_methods.html"
        extra_context = {"order": order, "robo_form": robo_form}
        return direct_to_template(
            request, template=template, extra_context=extra_context)
    else:
        raise Http404
Exemple #4
0
def top(request):
    return direct_to_template(request, template="index.html")