Exemple #1
0
def form_crear_elementoproteger(request, form=None, hecho=None):
    hecho = request.POST.get('hecho', hecho)
    services = RiesgoService()
    if not form:
        form = services.form_elementoproteger(request)
    #end if
    return render(request, 'riesgo/form_elementoproteger.html', {
        'form': form,
        'hecho': hecho
    })
Exemple #2
0
def form_editar_elementoproteger(request,
                                 elementoproteger,
                                 form=None,
                                 hecho=None):
    hecho = request.POST.get('hecho', hecho)
    services = RiesgoService()
    elementoproteger = services.mostrar_elementoproteger(
        request, elementoproteger)
    if elementoproteger:
        if not form:
            form = services.form_elementoproteger(request, elementoproteger)
        #end if
        return render(request, 'riesgo/form_elementoproteger.html', {
            'elementoproteger': elementoproteger,
            'form': form
        })
    #end if
    raise Http404