All pastes #112323 Raw Edit

Stuff

public python v1 · immutable
·published 2006-08-02 21:00 UTC
rendered paste body
def uploadfile(request):        manipulator = HomeworkUpload.AddManipulator()        if request.POST:        # New upload if data was POSTed.                new_data = request.POST.copy()                new_data.update(request.FILES)                errors = manipulator.get_validation_errors(new_data)                if not errors:                # No errors found.                        manipulator.do_html2python(new_data)                        hwkfile = manipulator.save(new_data)                        print("No errors")                        return HttpResponseRedirect("/hwk")                else:                        print(errors)                        errors = new_data = {}                        return HttpResponse("File uploaded")