Ejemplo n.º 1
0
def AddIdc(request):
    form = IdcListForm(request.POST)
    if form.is_valid():
        form.save()
        return HttpResponseRedirect(reverse('listidcurl'))
    else:
        form = IdcListForm()

    kwvars = {
        'form': form,
        'request': request,
    }

    return render_to_response('IdcManage/idc.add.html', kwvars, RequestContext(request))
Ejemplo n.º 2
0
def EditIdc(request, ID):
    idc = IdcList.objects.get(id=ID)

    if request.method == 'POST':
        form = IdcListForm(request.POST, instance=idc)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('listidcurl'))
    else:
        form = IdcListForm(instance=idc)

    kwvars = {
        'ID': ID,
        'form': form,
        'request': request,
    }

    return render_to_response('IdcManage/idc.edit.html', kwvars, RequestContext(request))
Ejemplo n.º 3
0
def AddIdc(request):
    form = IdcListForm(request.POST)
    if form.is_valid():
        form.save()
        return HttpResponseRedirect(reverse('listidcurl'))
    else:
        form = IdcListForm()

    kwvars = {
        'form': form,
        'request': request,
    }

    return render_to_response('IdcManage/idc.add.html', kwvars,
                              RequestContext(request))
Ejemplo n.º 4
0
def EditIdc(request, ID):
    idc = IdcList.objects.get(id=ID)

    if request.method == 'POST':
        form = IdcListForm(request.POST, instance=idc)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('listidcurl'))
    else:
        form = IdcListForm(instance=idc)

    kwvars = {
        'ID': ID,
        'form': form,
        'request': request,
    }

    return render_to_response('IdcManage/idc.edit.html', kwvars,
                              RequestContext(request))