Beispiel #1
0
def edit_build(request, build_id):
    build = get_object_or_404(Build, pk=build_id)
    form = BuildForm(request.POST or None, instance=build)
    if form.is_valid():
        form.save()
        return render(request, 'gctest/confirm.html', {'result' : "updated"})
    return render(request, 'gctest/edit.html', {'form' : form, 'view_url' : 'edit_build'})
Beispiel #2
0
def new_build(request):
    form = BuildForm(request.POST or None)
    if form.is_valid():
        form.save()
        return render(request, 'gctest/confirm.html', {'result': "added"})
    return render(request, 'gctest/new.html', {
        'form': form,
        'view_url': 'new_build'
    })
Beispiel #3
0
def edit_build(request, build_id):
    build = get_object_or_404(Build, pk=build_id)
    form = BuildForm(request.POST or None, instance=build)
    if form.is_valid():
        form.save()
        return render(request, 'gctest/confirm.html', {'result': "updated"})
    return render(request, 'gctest/edit.html', {
        'form': form,
        'view_url': 'edit_build'
    })
Beispiel #4
0
def new_build(request):
    form = BuildForm(request.POST or None)
    if form.is_valid():
        form.save()
        return render(request, 'gctest/confirm.html', {'result' : "added"})
    return render(request, 'gctest/new.html', {'form' : form, 'view_url' : 'new_build'})