예제 #1
0
 def process_request(self, request):
     try:
         request.current_section = Section.get_node_by_path(request.path)
         request.structure = Section.get_structure()
     except:
         request.current_section = None
         request.structure = {}
예제 #2
0
def action_catalog(request, id):
    context = get_default_context(request)
    product_in_actions = Action.objects.get(pk=id)
    action_id = []
    for product in product_in_actions.products.all():
        action_id.append(product.id)
    context['action_id'] = action_id
    context['catalog'] = Product.objects.filter(section=Section.get_node_by_path(request.POST['current_section'])).order_by('-order')
    return render_to_response('change_action/catalog.html', context)
예제 #3
0
def wtp_catalog(request, pid):
    context = get_default_context(request)
    product = Product.objects.get(pk=pid)
    wtp_pid = []
    for wtp in product.wtp.all():
        wtp_pid.append(wtp.id)
    context['wtp_pid'] = wtp_pid
    context['catalog'] = Product.objects.filter(section=Section.get_node_by_path(request.POST['current_section'])).order_by('-order')
    return render_to_response('wtp/catalog.html', context)
예제 #4
0
 def process_request(self, request):
     request.current_section = Section.get_node_by_path(request.path)
     request.structure = Section.get_structure()