def METHOD_NAME(request, prefix_id=None):
    """Controller for editing a prefix"""
    info = PrefixInfo()
    prefix, vlan = get_prefix_and_vlan(prefix_id)
    if request.method == 'POST':
        prefix_form = PrefixForm(request.POST, instance=prefix)
        vlan_form = PrefixVlanForm(request.POST, instance=vlan)
        if prefix_form.is_valid() and vlan_form.is_valid():
            vlan = vlan_form.save()
            prefix = prefix_form.save(commit=False)
            prefix.vlan = vlan
            prefix.save()
            msg = "Saved prefix %s" % prefix.net_address
            new_message(request, msg, Messages.SUCCESS)
            return HttpResponseRedirect(
                reverse('seeddb-prefix-edit', args=(prefix.id,))
            )
    else:
        prefix_form = PrefixForm(instance=prefix, initial=request.GET.dict())
        vlan_form = PrefixVlanForm(instance=vlan, initial=request.GET.dict())
    if prefix_id:
        detail_page_url = reverse_lazy(
            'prefix-details', kwargs={'prefix_id': prefix_id}
        )
    else:
        detail_page_url = ""
    context = info.template_context
    context.update(
        {
            'object': prefix,
            'form': prefix_form,
            'vlan_form': vlan_form,
            'sub_active': prefix and {'edit': True} or {'add': True},
            'detail_page_url': detail_page_url,
        }
    )
    return render_edit(
        request,
        Prefix,
        PrefixForm,
        prefix_id,
        "seeddb-prefix-edit",
        template="seeddb/edit_prefix.html",
        extra_context=context,
    )