Я создал представление, которое принимает 3 аргумента, но я получаю следующую ошибку на домашней странице. Реверс для 'evolucion_paciente' с аргументами '(5,)' не найден. Попробован 1 шаблон (ов): ['evolucion_paciente / (? P [0-9] +) / (? P [0-9] +) $']
Project / views.py - Один из моих просмотров
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})
Другой просмотр, и тот, с которым у меня проблемы
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})
В моем шаблоне ссылка, с которой мне нужно перенаправить меня мой первый взгляд на мой второй
<a href="{% url 'evolucion_paciente' evolucion.id %}" class="btn btn-warning">Ver</a>