Can I perform in django such operation, that in one view I assign a value of return from other view, that renders its own form template and basing on it returns value ? (So in other words if on this form rendered by the other function user clicks ok, I return true, and if user clicks cancel I return false) Sample code :
Main function:
def my_func(request):
result = False
result = redirect('some_url')
if result:
redirect somewhere
else:
redirect somewhere else
Child function called from parent with 'some_url' :
def some_url_func(request):
if request.POST.get("action") == "ok":
return True
elif if request.POST.get("action") == "cancel":
return False
Form:
<form action="some_url_func" method="post">
<input type="submit" class="submit" name="submit" action="ok" value="Ok" />
<input type="submit" class="submit" name="submit" action="cancel" value="Cancel" />
</form>
So basically is it possible to go through one view to some form and then return to this view ?