0
我有一個django應用程序。這是一個填表(如回答5個問題點擊下一個按鈕,並轉到下5個問題)。所有有問題的步驟都在1個視圖和1個html文件中呈現。如果我點擊about_us或其他鏈接(到另一個視圖和html文件),那麼後退按鈕點擊後面會出現「需要重新提交表單」,並從一開始就需要填寫。 如何嚴格回到原來的地方。表格重新提交Django如何避免刷新或返回按鈕
使用下一個代碼查看渲染模板。
@secure_required
def presubmit(request):
if request.user.is_authenticated():
profile = request.user.profile
try:
profile.vodID = dictresponse['soap:Envelope']['soap:Body']['InitiateVOAResponse']['VOD_ID']
except:
profile.vodID = ''
profile.save()
lo = {}
try:
lo_user = User.objects.get(email=request.user.profile.loanOfficer)
lo_obj = LoanManager.objects.get(user=lo_user)
lo['isChosen'] = True
lo['name'] = lo_obj.user.profile.firstName + ' '+lo_obj.user.profile.lastName
lo['email'] = request.user.profile.loanOfficer
lo['nmlsID'] = lo_obj.nmlsID
lo['phone'] = lo_obj.phone
except:
lo['isChosen'] = False
load = False
try:
preapp = PreApp.objects.filter(username=request.user.username).order_by('-id')[0]
load = True
except:
pass
return render_to_response('home/revisedVersion.html', {'user': request.user, 'lo':lo, 'accountcheckURL': accountcheckURL,'load':load}, context_instance=RequestContext(request))
return render_to_response('home/revisedVersionSignup.html', {'user': User.objects.get(email='[email protected]')}, context_instance=RequestContext(request))
revisedVersionSignup有,如果用戶進行身份驗證,並做了NPT在中間步驟
空白和模式填充是我目前使用,但客戶希望它以另一種方式) ))\ –