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'})
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' })
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' })
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'})