예제 #1
0
파일: views.py 프로젝트: danribeiro/sigee
def adiciona_ece(request):
	if request.method=='POST':
		form=FormECE(request.POST,request.FILES)
		if form.is_valid():
			form.save()
			return render_to_response('ece/add_ece.html',{'form':form},context_instance=RequestContext(request))
	else:
		form=FormECE()				
	return render_to_response('ece/add_ece.html',{'form':form},context_instance=RequestContext(request))
예제 #2
0
파일: views.py 프로젝트: danribeiro/sigee
def edita_ece(request,nr_item):
	objeto=ECE.objects.get(pk=nr_item)
	if request.method=='POST':
		form=FormECE(request.POST,instance=objeto)		
		if form.is_valid():
			form.save()
			return render_to_response('ece/edita_ece.html',{'form':form},context_instance=RequestContext(request))
	else:
		form=FormECE(instance=objeto)
	return render_to_response('ece/edita_ece.html',{'form':form},context_instance=RequestContext(request))