@permission_required("core.manage_shop")
def add_discount(request, template_name="manage/discounts/add_discount.html"):
    if request.method == "POST":
        form = DiscountForm(data=request.POST, files=request.FILES)
        if form.is_valid():
            new_discount = form.save()
            return lfs.core.utils.set_message_cookie(
                url=reverse("lfs_manage_discount", kwargs={"id": new_discount.id}),
                msg=_(u"Discount method has been added."),
            )
    else:
        form = DiscountForm()

    return render_to_response(template_name, RequestContext(request, {
        "navigation": navigation(request),
        "form": form,
        "came_from": (request.POST if request.method == 'POST' else request.GET).get("came_from",
                                                                                     reverse("lfs_manage_discounts")),
    }))
Provides an add form and saves a new discount method.
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/discounts/views.py/add_discount