def resume_view(request): if request.method == 'POST': f = ResumeForm(request.POST, instance=Resume.objects.get(user=request.user)) if f.is_valid(): f.save() return render_resume(request) else : print f.errors return render_resume(request) return render_resume(request, request.GET.get('tab'))
def create(request): # save entry to the resume model given data from submitted form if request.POST: instance = Resume.objects.get(request.user) form = ResumeForm(request.POST, instance) if form.is_valid(): form.save() return HttpResponseRedirect('resume/about/create') else: form = ResumeForm(initial={'user': request.user}) args = {} args.update(csrf(request)) args['form'] = form return render_to_response('builder/create_resume.html', args)
def create(request): # save entry to the resume model given data from submitted form if request.POST: instance = Resume.objects.get(request.user) form = ResumeForm(request.POST, instance) if form.is_valid(): form.save() return HttpResponseRedirect('resume/about/create') else: form = ResumeForm(initial={'user': request.user}) args = {} args.update(csrf(request)) args['form'] = form return render_to_response('builder/create_resume.html',args)
def new_resume(request): # renders an empty form used to create new resume instance if request.method == 'POST': # create new resume from form form = ResumeForm(request.POST) if form.is_valid(): resume = form.save(commit=False) resume.user = request.user resume.save() return HttpResponseRedirect('/resume/') else: # create form to make new resume form = ResumeForm(initial={'user': request.user}) args = {} args.update(csrf(request)) args['form'] = form return render_to_response('builder/create_resume.html', args)
def new_resume(request): # renders an empty form used to create new resume instance if request.method == 'POST': # create new resume from form form = ResumeForm(request.POST) if form.is_valid(): resume = form.save(commit=False) resume.user = request.user resume.save() return HttpResponseRedirect('/resume/') else: # create form to make new resume form = ResumeForm(initial={'user': request.user}) args = {} args.update(csrf(request)) args['form'] = form return render_to_response('builder/create_resume.html',args)