I have 2 views:
def matching(request: HttpRequest) -> HttpResponse:
context = Transaction.objects.order_by("-transaction_date").all()
if request.method == 'POST':
evidence_data = to_json(request.body)
return render(request,
"evidence/matching.html",
{"transactions": context,
"evidence_data": evidence_data
})
return render(request, "evidence/matching.html", {"transactions": context})
def evidence(request: HttpRequest) -> HttpResponse:
if request.method == 'POST':
data = to_json(request.body)
if data:
return matching(request)
context = TransactionEvidence.objects.order_by("-uploaded_at").all()
return render(request, "evidence/evidence.html", {"evidence": context})
After the first view gets a post request, I want the other view to render with the transaction data and the data from the evidence view.
The view is called, and the data is there and what I would expect, but in the browser, nothing is happening.
What am I missing?