Ejemplo n.º 1
0
def edit(request, offset):
	offset = get_object_or_404(Page, pk=offset)
	if request.method == 'POST':
		form = WebsiteForm(request.POST, instance=offset)
		if form.is_valid():
			form.save()
			return HttpResponseRedirect('/site/admin')
	else:
		form = WebsiteForm(instance=offset)

	return render_to_response("cms/cms.html", {'form': form}, 
		context_instance=RequestContext(request))
Ejemplo n.º 2
0
def cms(request):
	if request.method == 'POST':
		form = WebsiteForm(request.POST)
		if form.is_valid():
			newpage = form.save(commit=False)
			newpage.order = order_for_last_page()
			newpage.save()

			return HttpResponseRedirect('/site/admin')
	else:
		form = WebsiteForm()
	return render_to_response("cms/cms.html", 
		{ "form": form }, 
		context_instance=RequestContext(request))
Ejemplo n.º 3
0
Archivo: views.py Proyecto: somair/xvs
def edit(request, offset):
    offset = get_object_or_404(Page, pk=offset)
    if request.method == 'POST':
        form = WebsiteForm(request.POST, instance=offset)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect('/site/admin')
    else:
        form = WebsiteForm(instance=offset)

    return render_to_response("cms/cms.html", {'form': form},
                              context_instance=RequestContext(request))
Ejemplo n.º 4
0
Archivo: views.py Proyecto: somair/xvs
def cms(request):
    if request.method == 'POST':
        form = WebsiteForm(request.POST)
        if form.is_valid():
            newpage = form.save(commit=False)
            newpage.order = order_for_last_page()
            newpage.save()

            return HttpResponseRedirect('/site/admin')
    else:
        form = WebsiteForm()
    return render_to_response("cms/cms.html", {"form": form},
                              context_instance=RequestContext(request))