Pass value from one function to another in Views.py Django

preview_player
Показать описание
Pass value from one view to another in Django
Рекомендации по теме
Комментарии
Автор

Thank you very much sir...
I was facing problem with global variable in django and your way solved it thank you much

BhargabGanguli
Автор

Thank you so much sir, I was searching for a solution wrt global variables in django, this helped me.

annapurnabelavatagi
Автор

but using global function we cannot handle multiple request..in django My scenarion is
def func1(request):
global data
data=getDataFromDatabase()
def func2():
print(data)

First user retrive data and call func2() then print data but another user call func1() and call func2() that time first user data is change.

ashishphadtare
Автор

Superb sir
Sir I hv doubt that I hv selected id for this I want find another table. How get related id values and pass to another input box

asgeralia
Автор

Thank you so much this video is very helpful. The Global one is what I want cause I usually use it in every prog. language when creating login and reg. feature and I didn't expect that global value exist in django xD still newbie

kirisko
Автор

Thank you very much for solving me this problem

MCM_Harish
Автор

Thanks, I was stuck because I was doing otp verification and I've to send form to another function which I want to save later if the code was right.

ai.
Автор

if not form.is_valid():
return render(request...
userid = form.cleaned_data["userid"]
password = ...
if not match:
return render(request...
matchh = ...
if not matchh:
return render(request...
return redirect(Teacher_account)

See how you don't have to write spaghetti code when ruling out unwanted conditions first?

maelstrom
Автор

thanks a lot bro it helped me a lot !!!

vyomkeshgupta