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