Beispiel #1
0
def new_curso(request):
    if request.method == 'POST':
        form = CursoForm(request.POST)
        if form.is_valid():
            curso = form.save()
            admin_log_addition(request, curso, 'Curso Registrado')
            sms = 'Curso Registrado Correctamente'
            messages.success(request, sms)
            return HttpResponseRedirect(reverse(index))
    else:
        form = CursoForm()
    return render(request, 'cursos/new.html', {
        'form':form,
    })
Beispiel #2
0
def new_gestion(request):
    if request.method == 'POST':
        form = GestionForm(request.POST)
        if form.is_valid():
            g = form.save()
            admin_log_addition(request, g, 'Gestion Registrada Correctamente')
            sms = 'Gestion Registrada Correctamente'
            messages.success(request, sms)
            return HttpResponseRedirect(reverse(index))
    else:
        form = GestionForm()
    return render(request, 'gestiones/new.html', {
        'form': form,
    })
Beispiel #3
0
def new(request):
    if request.method == 'POST':
        form = ParticipanteForm(request.POST)
        if form.is_valid():
            p = form.save()
            admin_log_addition(request, p, 'Participante Registrado')
            sms = 'Participantes Registrado Correctamente'
            messages.success(request, sms)
            return HttpResponseRedirect(reverse(index))
    else:
        form = ParticipanteForm()
    return render(request, 'participantes/new.html', {
        'form': form,
    })
Beispiel #4
0
def new_ciclo(request):
    gestion = Gestion.objects.get(gestion=request.session['gestion'])
    if request.method == 'POST':
        form = CicloForm(request.POST)
        if form.is_valid():
            c = form.save(commit=False)
            c.gestion = gestion
            c.save()
            admin_log_addition(request, c, 'Ciclo Creado')
            sms = 'Ciclo Creado Correctamente'
            messages.success(request, sms)
            return HttpResponseRedirect(reverse(index))
    else:
        form = CicloForm()
    return render(request, 'ciclos/new.html', {
        'form':form,
    })
Beispiel #5
0
def new(request):
    gestion = Gestion.objects.get(gestion=request.session['gestion'])
    if request.method == 'POST':
        form = EventoForm()
        if form.is_valid():
            evento = form.save(commit=False)
            evento.user = request.user
            evento.gestion = gestion
            evento.save()
            admin_log_addition(request, 'Evento Regsitrado')
            sms = 'Evento Registrado Correctamente'
            messages.success(request, sms)
            return HttpResponseRedirect(reverse(index))
    else:
        form = EventoForm()
    return render(request, 'eventos/new.html', {
        'form': form,
    })