@permission_required("core.manage_shop")
def add_shipping_method(request,
    template_name="manage/shipping_methods/add_shipping_method.html"):
    if request.method == "POST":
        form = ShippingMethodAddForm(data=request.POST)
        if form.is_valid():
            new_shipping_method = form.save()
            return lfs.core.utils.set_message_cookie(
                url=reverse("lfs_manage_shipping_method", kwargs={"shipping_method_id": new_shipping_method.id}),
                msg=_(u"Shipping method has been added."),
            )
    else:
        form = ShippingMethodAddForm()

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