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 = {}
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)
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)
 def process_request(self, request):
     request.current_section = Section.get_node_by_path(request.path)
     request.structure = Section.get_structure()