@permission_required("core.manage_shop")
def discount_criteria(request, id, template_name="manage/discounts/criteria.html"):
    discount = Discount.objects.get(pk=id)

    criteria = []
    position = 0
    for criterion_object in discount.get_criteria():
        position += 10
        criterion_html = criterion_object.get_content_object().render(request, position)
        criteria.append(criterion_html)

    return render_to_string(template_name, RequestContext(request, {
        "discount": discount,
        "criteria": criteria,
    }))


# Actions
Returns the criteria of the discount with passed id as HTML.
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/discounts/views.py/discount_criteria