Exemple #1
0
def add_db_config(request):
    if request.method == "POST":
        form = DbConfigForm(request.POST)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('db_config'))
    else:
        form = DbConfigForm()
    return render_to_response('database/add_db_config.html', locals(), RequestContext(request))
Exemple #2
0
def add_db_config(request):
    if request.method == "POST":
        form = DbConfigForm(request.POST)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('db_config'))
    else:
        form = DbConfigForm()
    return render_to_response('database/add_db_config.html', locals(),
                              RequestContext(request))
Exemple #3
0
def edit_db_config(request, ID):
    the_db_config = DbConfig.objects.get(id=ID)
    if request.method == "POST":
        form = DbConfigForm(request.POST, instance=the_db_config)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('db_config'))
    else:
        form = DbConfigForm(instance=the_db_config)
    return render_to_response('database/edit_db_config.html', locals(), RequestContext(request))
Exemple #4
0
def edit_db_config(request, ID):
    the_db_config = DbConfig.objects.get(id=ID)
    if request.method == "POST":
        form = DbConfigForm(request.POST, instance=the_db_config)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('db_config'))
    else:
        form = DbConfigForm(instance=the_db_config)
    return render_to_response('database/edit_db_config.html', locals(),
                              RequestContext(request))