All pastes #111991 Raw Edit

Something

public python v1 · immutable
·published 2006-08-02 16:22 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 = request.FILES                groupadd = request.POST['togroup']                errors = manipulator.get_validation_errors(new_data)                if not errors:                # No errors found.                        manipulator.do_html2python(new_data)                        manipulator.do_html2python(groupadd)                        hwkfile = manipulator.save(new_data)                        togroup = manipulator.save(groupadd)                        print("No errors")                        return HttpResponseRedirect("/hwk")                else:                        print(errors)                        errors = new_data = {}                        return HttpResponse("File uploaded")