Example #1
0
def new_funcion(request):
    if request.method == 'POST' :
        formulario = FuncionForm(request.POST, request.FILES)
        if formulario.is_valid():
            formulario.save()
            return HttpResponseRedirect('/organizacion')
    else:
        formulario = FuncionForm()
    return  render_to_response('cargo/new_funcion.html', {'formulario' :formulario}, context_instance=RequestContext(request))
Example #2
0
def update_funcion(request, id_funcion):
    funcion = get_object_or_404(Funciones, pk = id_funcion)
    if request.method == 'POST':
        formulario = FuncionForm(request.POST, instance=funcion)
        if formulario.is_valid():
            formulario.save()
            return HttpResponseRedirect('/funcion/option')
    else:
        formulario = FuncionForm(instance=funcion)
    return render_to_response('cargo/update_funcion.html', {'formulario' :formulario}, context_instance=RequestContext(request))
Example #3
0
def new_funcion(request):
    if request.method == 'POST':
        formulario = FuncionForm(request.POST, request.FILES)
        if formulario.is_valid():
            formulario.save()
            return HttpResponseRedirect('/organizacion')
    else:
        formulario = FuncionForm()
    return render_to_response('cargo/new_funcion.html',
                              {'formulario': formulario},
                              context_instance=RequestContext(request))
Example #4
0
def update_funcion(request, id_funcion):
    funcion = get_object_or_404(Funciones, pk=id_funcion)
    if request.method == 'POST':
        formulario = FuncionForm(request.POST, instance=funcion)
        if formulario.is_valid():
            formulario.save()
            return HttpResponseRedirect('/funcion/option')
    else:
        formulario = FuncionForm(instance=funcion)
    return render_to_response('cargo/update_funcion.html',
                              {'formulario': formulario},
                              context_instance=RequestContext(request))