コード例 #1
0
def form_atendimento(request):
	newcadastro = 'S'
	if request.method == 'POST':
		atendimento_form = AtendimentoForm(request.POST, request.FILES)
		if atendimento_form.is_valid():
			atendimento_form.save()
			atendimento_form = AtendimentoForm()
			return render(request, 'form_atendimento.html', {'atendimento_form': atendimento_form, 'newcadastro': newcadastro})			
			#return redirect('/')
	else:
		atendimento_form = AtendimentoForm()

	return render(request, 'form_atendimento.html', {'atendimento_form': atendimento_form, 'newcadastro': newcadastro})