def update(request, pk, slug=None, template='contacts/group/update.html'):

    user = request.user
    if not user.has_perm('change_group'):
        return HttpResponseForbidden()

    try:
        group = Group.objects.get(pk__iexact=pk)
    except Group.DoesNotExist:
        raise Http404

    form = GroupUpdateForm(instance=group)

    if request.method == 'POST':
        form = GroupUpdateForm(request.POST, instance=group)

        if form.is_valid():
            form.save()
            return HttpResponseRedirect(group.get_absolute_url())

    kwvars = {
        'form': form,
        'object': group,
    }

    return render_to_response(template, kwvars, RequestContext(request))
Update a group.
dataset/ETHPy150Open myles/django-contacts/src/contacts/views/group.py/update