Gregory Strydom
2018-11-07 14:50:00 UTC
Hi there.
I am really not sure how to phrase this questions so I will just do my best.
On the homepage of my app I have a table with information. Most of the
information in each cell is also a link to a details page like so:
<td><a href="{% url 'kpi_detail' incident.id">{{ incident.ir_num }}</a></td>
What I am struggling to get working is adding another link to a different
cell in the same table.
<td><a href="{% url 'kpi_eftdetail' eftlead.id">{{
incident.eft_lead}}</a></td>
My 2 urls are set us as such:
url(r'^detail/(?P<incident_id>\d+)$', views.incident_detail,
name='kpi_detail'),
url(r'^eftlead/(?P<eftlead>\d+)$', views.eftlead_detail,
name='kpi_eftdetail')
My index view is like so:
def kpi_index(request):
context = dict()
context['incidents'] = KPIIncidents.objects.all()
return render(request, 'kpi/index.html', context)
If I set everything up like that I am getting an error of no reverse match
on the index page. I think the problem I am having is I am not setting up
the eft_lead link properly in the index view, but I am not sure how I would
go about this.
It is very difficult to explain without showing my whole source code I
think but I am not sure how to do that on Google groups.
Any help would be much appreciated. Thank you!
I am really not sure how to phrase this questions so I will just do my best.
On the homepage of my app I have a table with information. Most of the
information in each cell is also a link to a details page like so:
<td><a href="{% url 'kpi_detail' incident.id">{{ incident.ir_num }}</a></td>
What I am struggling to get working is adding another link to a different
cell in the same table.
<td><a href="{% url 'kpi_eftdetail' eftlead.id">{{
incident.eft_lead}}</a></td>
My 2 urls are set us as such:
url(r'^detail/(?P<incident_id>\d+)$', views.incident_detail,
name='kpi_detail'),
url(r'^eftlead/(?P<eftlead>\d+)$', views.eftlead_detail,
name='kpi_eftdetail')
My index view is like so:
def kpi_index(request):
context = dict()
context['incidents'] = KPIIncidents.objects.all()
return render(request, 'kpi/index.html', context)
If I set everything up like that I am getting an error of no reverse match
on the index page. I think the problem I am having is I am not setting up
the eft_lead link properly in the index view, but I am not sure how I would
go about this.
It is very difficult to explain without showing my whole source code I
think but I am not sure how to do that on Google groups.
Any help would be much appreciated. Thank you!
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6ac26c7e-be21-468c-9146-25be6b28ee57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6ac26c7e-be21-468c-9146-25be6b28ee57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.