Exemple #1
0
def edit_developer(request, developer_id):
    developer = get_object_or_404(Developer, pk=developer_id)
    form = DeveloperForm(request.POST or None, instance=developer)
    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_developer'})
Exemple #2
0
def new_developer(request):
    form = DeveloperForm(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_developer'
    })
Exemple #3
0
def edit_developer(request, developer_id):
    developer = get_object_or_404(Developer, pk=developer_id)
    form = DeveloperForm(request.POST or None, instance=developer)
    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_developer'
    })
Exemple #4
0
def new_developer(request):
    form = DeveloperForm(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_developer'})