예제 #1
0
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'))
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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)
예제 #5
0
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)