Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from forms import Form1, Form2
- def ler_arquivo(request):
- form_action = ''
- if request.method == 'POST':
- form = Form1(request.POST, request.FILES)
- if form.is_valid():
- form = Form2(initial={'texto': form.ler_conteudo_do_arquivo()})
- form_action = reverse('salvar_arquivo')
- else:
- form = Form1()
- return direct_to_template(request, "nome_do_template_form1.html", {'form': form, 'form_action': form_action})
- def salvar_arquivo(request):
- if request.method == 'POST':
- form = Form2(request.POST)
- if form.is_valid():
- (faz o que quiser com o form)
- else:
- form = Form2()
- return direct_to_template(request, "nome_do_template_form2.html", {'form': form})
Add Comment
Please, Sign In to add comment