Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.shortcuts import render, redirect
- from core.forms import bilhete, ocorrencia, locais_de_ocorrencias, informacoes_de_ocorrencia, parecer_pop, servico_interjato, material, material_retorno
- # Create your views here.
- def home(request):
- var = '123'
- return render(request, 'core/index.html', {'var': var})
- def bilhetef(request):
- formbilhete = bilhete(request.POST or None)
- formocorre = ocorrencia(request.POST or None)
- formlocalocorre = locais_de_ocorrencias(request.POST or None)
- forminfoocorre = informacoes_de_ocorrencia(request.POST or None)
- formparecerpop = parecer_pop(request.POST or None)
- formserinterj = servico_interjato(request.POST or None)
- formmateriais = material(request.POST or None)
- formmatertrn = material_retorno(request.POST or None)
- if request.POST:
- form_bilhete = formbilhete.save()
- formocorre.save(commit=False)
- formocorre.id_bilhete = form_bilhete
- formocorre.save()
- formlocalocorre.save(commit=False)
- formlocalocorre.id_bilhete = form_bilhete
- formlocalocorre.save()
- forminfoocorre.save(commit=False)
- forminfoocorre.id_bilhete = form_bilhete
- forminfoocorre.save()
- formparecerpop.save(commit=False)
- formparecerpop.id_bilhete = form_bilhete
- formparecerpop.save()
- formserinterj.save(commit=False)
- formserinterj.id_bilhete = form_bilhete
- formserinterj.save()
- formmateriais.save(commit=False)
- formmateriais.id_bilhete = form_bilhete
- formmateriais.save()
- formmatertrn.save(commit=False)
- formmatertrn.id_bilhete = form_bilhete
- formmatertrn.save()
- return render(request, 'core/formulario.html', {'bilhete': formbilhete, 'ocorre': formocorre, 'lococorre': formlocalocorre, 'infocorre': forminfoocorre,'parecerpop': formparecerpop, 'servinter': servico_interjato, 'material': formmateriais, 'materialretrn':formmatertrn})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement