Django's usual form handling basically assumes that it's a non-ajax submit, so for error cases it will re-draw the form, repopulated with error messages.
It basically become most succinct in code to have a GET at the URL be rendering the form and a POST to the same be the submission, so that's how their examples work  (Note this is not very RESTful).
So, that's why you can't assume @require_POST.   (Although technically in our action.py file we could.  I guess I just wanted to maintain the django idiom.)

We have many of these django-style forms, but the exam form is not one of them--maybe I'll try to move it closer at some point.

On Jan 5, 2013, at 10:45 AM, Joe Blaylock <notifications@github.com> wrote:

> In main/courses/files/actions.py:
> 
> >               'form': form,
> >               })
> >  
> >  @auth_is_course_admin_view_wrapper
> > +def edit(request):
> > +    course_prefix = request.POST.get("course_prefix")
> > +    course_suffix = request.POST.get("course_suffix")
> > +    file_id = request.POST.get("file_id","-1")
> > +    common_page_data = get_common_page_data(request, course_prefix, course_suffix)
> > +    try:
> > +        file=File.objects.get(id=int(file_id), course=common_page_data['draft_course'])
> > +    except File.DoesNotExist:
> > +        raise Http404
> > +
> > +    if request.method == "POST":
> For my education, can you comment on the tradeoffs between doing this and wrapping the whole method in @require_POST and then just assuming that we have one?
> 
> —
> Reply to this email directly or view it on GitHub.
> 
>