def METHOD_NAME(request, item_type, item_id):
    registration_types = {"calculator": CalculatorRegistration, "computer": ComputerRegistration, "phone": PhoneRegistration}
    if item_type not in registration_types:
        raise http.Http404
    obj = get_object_or_404(registration_types[item_type], id=item_id, user=request.user)
    if request.method == "POST" and "confirm" in request.POST:
        obj.delete()
        messages.success(request, "Deleted {}".format(item_type))
        return redirect("itemreg")
    return render(request, "itemreg/register_delete.html", {"type": item_type, "obj": obj})