def METHOD_NAME(request, id, form_class=StoryForm, template_name="stories/edit.html"):
    story = get_object_or_404(Story, pk=id)
    if has_perm(request.user,'stories.change_story', story):
        if request.method == "POST":
            form = form_class(request.POST, request.FILES,
                              instance=story, user=request.user)
            if form.is_valid():
                story = form.save(commit=False)
                # save photo
                photo = form.cleaned_data['photo_upload']
                if photo:
                    story.save(photo=photo)
                story = update_perms_and_save(request, form, story)
                messages.add_message(request, messages.SUCCESS, _('Successfully updated %(str)s' % {'str': str(story)}))
                redirect_to = request.POST.get('next', '')
                if redirect_to:
                    return HttpResponseRedirect(redirect_to)
                else:
                    return redirect('story', id=story.pk)
        else:
            form = form_class(instance=story, user=request.user)
    else:
        raise Http403
    return render_to_resp(request=request, template_name=template_name,
        context={'story': story, 'form':form })