Beispiel #1
0
def edit_app(request, app_id):
    app = get_object_or_404(App, pk=app_id)
    form = AppForm(request.POST or None, instance=app)
    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_app'})
Beispiel #2
0
def new_app(request):
    form = AppForm(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_app'
    })
Beispiel #3
0
def edit_app(request, app_id):
    app = get_object_or_404(App, pk=app_id)
    form = AppForm(request.POST or None, instance=app)
    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_app'
    })
Beispiel #4
0
def new_app(request):
    form = AppForm(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_app'})