Example #1
0
def templates_delete(request):
    TemplateFormSet = modelformset_factory(Template, can_delete=True, extra=0)
    if request.method == 'POST':
        formset = TemplateFormSet(request.POST, request.FILES)
        if formset.is_valid():
            c = {}
            formset.save()
            return redirect('/templates/show/all/')
    else:
        formset = TemplateFormSet()
        c = {'formset': formset}
        c.update(csrf(request))
    return render_to_response("delete_templates.html", c)
Example #2
0
def templates_delete(request):
    TemplateFormSet = modelformset_factory(Template, can_delete=True, extra=0)
    if request.method == 'POST':
        formset = TemplateFormSet(request.POST, request.FILES)
        if formset.is_valid():
            c = {}
            formset.save()
            return redirect('/templates/show/all/')   
    else:
        formset = TemplateFormSet()
        c = {'formset': formset}
        c.update(csrf(request))
    return render_to_response("delete_templates.html", c)
Example #3
0
def templates_edit_all(request):
    TemplateFormSet = modelformset_factory(Template, extra=0)
    if request.method == 'POST':
        formset = TemplateFormSet(request.POST, request.FILES)
        if formset.is_valid():
            c = {}
            formset.save()
            return render_to_response('pendings_show_all.html')
    else:
        formset = TemplateFormSet()
        c = {'formset': formset}
        c.update(csrf(request))

    return render_to_response("edit_templates.html", c)
Example #4
0
def templates_edit_all(request):
    TemplateFormSet = modelformset_factory(Template,extra=0)
    if request.method == 'POST':
        formset = TemplateFormSet(request.POST, request.FILES)
        if formset.is_valid():
            c = {}
            formset.save()
            return render_to_response('pendings_show_all.html')
    else:
        formset = TemplateFormSet()
        c = {'formset': formset}
        c.update(csrf(request))
        
    return render_to_response("edit_templates.html", c)