Beispiel #1
0
def adicionarCompromisso(request):
    form = CadastroCompromisso()
    if request.method == 'POST':
        form = CadastroCompromisso(request.POST) 
        if form.is_valid():
            agenda = Agenda()
            return agenda.inserirCompromisso(request)
    context_instance = RequestContext(request, { 'form' : form})
    return render_to_response("professor/adicionar-compromisso.html", context_instance)
Beispiel #2
0
def editarCompromisso(request, id):
    c = get_object_or_404(Compromisso, pk=id)
    form = CadastroCompromisso(instance=c)
    if request.method == 'POST':
        form = CadastroCompromisso(request.POST) 
        if form.is_valid():
            agenda = Agenda()
            return agenda.editarCompromisso(request, id)
    context_instance = RequestContext(request, { 'form' : form})
    return render_to_response("professor/editar-compromisso.html", context_instance)
Beispiel #3
0
def getCompromissos(request):
    agenda = Agenda()
    return agenda.getCompromisso() 
Beispiel #4
0
def excluirCompromisso(request, id):
    agenda = Agenda()
    return agenda.excluirCompromisso(request, id)