Exemplo n.º 1
0
def result_list(cl):
    mycl = {}
    group_rule_manager = CGroupRuleManager()
    mycl.update(admin_list_result_list(cl))
    # comment next string, if you want to see normal view of productrule_list
    mycl['results'] = group_rule_manager.make_grouping_result_list(cl)
    return mycl
Exemplo n.º 2
0
    return render_to_response('admin/create_new_rules.html', params,
                                  RequestContext(request))

def return_from_collect(request, product_id):
    tracker_manger = CTrackerManagerService(product_id)
    tracker_manger.stop_tracker()
    tracker_manger.clear_buffer()
    return redirect('admin:core_product_change', product_id)

# for saving activate grouping
def activate_and_save(request):
    id = request.GET.dict().get('id')
    type = request.GET.dict().get('type')
    try:
        toogle = not bool(int(request.GET.dict().get('toggle')))  # Revert value for changing the value in db
    except Exception, e:
        toogle = False

    group_rule_manager = CGroupRuleManager()
    if type == 'group':
        answer_response = group_rule_manager.toggle_group(id, toogle)
    elif type == 'rule':
        answer_response = group_rule_manager.toggle_rule_by_id(id, toogle)
    else:
        answer_response = {'status': False,
                           'message': "type is incorrect",
                           'values': []}

    return HttpResponse(json.dumps(answer_response),
                        content_type="application/json")
Exemplo n.º 3
0
 def show_rule_activate(self, obj):
     group_manager = CGroupRuleManager()
     return group_manager.get_image_attribute(obj, obj.rule_activate)