I have created a view that accepts 3 arguments but I get the following error in the homepage.Reverse for 'evolucion_paciente' with arguments '(5,)' not found. 1 pattern(s) tried: ['evolucion_paciente/(?P[0-9]+)/(?P[0-9]+)$']
Project/views.py -- One of my views
def VerEvoluciones(request, id):
if request.method == 'GET':
paciente = Paciente.objects.get(id= id)
evoluciones = Evolucion.objects.filter(paciente= id).order_by('-fechaEvolucion')
evolucionForm = EvolucionForm()
else:
return redirect('index')
return render(request, 'evoluciones.html', {'evolucionForm': evolucionForm, "Evoluciones": evoluciones, "Paciente": paciente})
Another View, and the one which im having troubles with
def VerEvolucion(request, id, id_e):
evolucionForm= None
evolucion= None
try:
if request.method == 'GET':
paciente = Paciente.objects.get(id= id)
evolucion = Evolucion.objects.filter(paciente= id).get(id= id_e)
evolucionForm = EvolucionForm(instance= evolucion)
else:
return redirect('index')
except ObjectDoesNotExist as e:
error = e
return render(request, 'evolucion.html', {'evolucionForm': evolucionForm,
'Evolucion': evolucion,
'Paciente': paciente,
'Ver': True})
In my template, the link that i need to redirect me from my firt view to my second one
<a href="{% url 'evolucion_paciente' evolucion.id %}" class="btn btn-warning">Ver</a>