Discussion:
Link ID's To Detail Page
Gregory Strydom
2018-11-07 14:50:00 UTC
Permalink
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!
--
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.
Matthew Pava
2018-11-07 14:53:55 UTC
Permalink
If you just copied and pasted from your template into this email, the problem is a syntax error. You did not close your URL tag with a %}.
<td><a href="{% url 'kpi_detail' incident.id %}">{{ incident.ir_num }}</a></td>
<td><a href="{% url 'kpi_eftdetail' eftlead.id %}">{{ incident.eft_lead}}</a></td>


From: django-***@googlegroups.com [mailto:django-***@googlegroups.com] On Behalf Of Gregory Strydom
Sent: Wednesday, November 7, 2018 8:50 AM
To: Django users
Subject: Link ID's To Detail Page

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!




--
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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<https://groups.google.com/d/msgid/django-users/6ac26c7e-be21-468c-9146-25be6b28ee57%40googlegroups.com?utm_medium=email&utm_source=footer>.
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/66b71828e2564644a38327d875693e43%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.
Gregory Strydom
2018-11-07 14:57:35 UTC
Permalink
Sorry I typed it in here incorrectly. Thank you for spotting that though :)
It is the correct way in my source file.
Post by Matthew Pava
If you just copied and pasted from your template into this email, the
problem is a syntax error. You did not close your URL tag with a %}.
<td><a href="{% url 'kpi_detail' incident.id *%}*">{{ incident.ir_num
}}</a></td>
<td><a href="{% url 'kpi_eftdetail' eftlead.id* %}*">{{
incident.eft_lead}}</a></td>
*Sent:* Wednesday, November 7, 2018 8:50 AM
*To:* Django users
*Subject:* Link ID's To Detail Page
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
<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>
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')
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
<javascript:>.
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
<https://groups.google.com/d/msgid/django-users/6ac26c7e-be21-468c-9146-25be6b28ee57%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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/84ef7752-b46d-4158-9128-b80fc58850e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Matthew Pava
2018-11-07 15:00:55 UTC
Permalink
Oh, I see it now.
Your second URL doesn’t correspond with the object that is inside the cell.
You probably meant {% url ‘kpi_eftdetail’ incident.eft_lead.id %}

From: django-***@googlegroups.com [mailto:django-***@googlegroups.com] On Behalf Of Gregory Strydom
Sent: Wednesday, November 7, 2018 8:58 AM
To: Django users
Subject: Re: Link ID's To Detail Page

Sorry I typed it in here incorrectly. Thank you for spotting that though :) It is the correct way in my source file.

On Wednesday, 7 November 2018 16:55:15 UTC+2, Matthew Pava wrote:
If you just copied and pasted from your template into this email, the problem is a syntax error. You did not close your URL tag with a %}.
<td><a href="{% url 'kpi_detail' incident.id<http://incident.id> %}">{{ incident.ir_num }}</a></td>
<td><a href="{% url 'kpi_eftdetail' eftlead.id<http://eftlead.id> %}">{{ incident.eft_lead}}</a></td>


From: ***@googlegroups.com<javascript:> [mailto:***@googlegroups.com<javascript:>] On Behalf Of Gregory Strydom
Sent: Wednesday, November 7, 2018 8:50 AM
To: Django users
Subject: Link ID's To Detail Page

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<http://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<http://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-***@googlegroups.com<javascript:>.
To post to this group, send email to ***@googlegroups.com<javascript:>.
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<https://groups.google.com/d/msgid/django-users/6ac26c7e-be21-468c-9146-25be6b28ee57%40googlegroups.com?utm_medium=email&utm_source=footer>.
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<mailto:django-users+***@googlegroups.com>.
To post to this group, send email to django-***@googlegroups.com<mailto: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/84ef7752-b46d-4158-9128-b80fc58850e4%40googlegroups.com<https://groups.google.com/d/msgid/django-users/84ef7752-b46d-4158-9128-b80fc58850e4%40googlegroups.com?utm_medium=email&utm_source=footer>.
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/bd05ace6295741c39634059eb343c335%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.
Gregory Strydom
2018-11-07 15:18:27 UTC
Permalink
Thats it! Thank you so much :P I''ve been struggling for 2 hours and you
solved it in 5 minutes. Much appreciated!!
Post by Matthew Pava
Oh, I see it now.
Your second URL doesn’t correspond with the object that is inside the cell.
You probably meant {% url ‘kpi_eftdetail’ *incident.eft_lead*.id %}
*Sent:* Wednesday, November 7, 2018 8:58 AM
*To:* Django users
*Subject:* Re: Link ID's To Detail Page
Sorry I typed it in here incorrectly. Thank you for spotting that though
:) It is the correct way in my source file.
If you just copied and pasted from your template into this email, the
problem is a syntax error. You did not close your URL tag with a %}.
<td><a href="{% url 'kpi_detail' incident.id *%}*">{{ incident.ir_num
}}</a></td>
<td><a href="{% url 'kpi_eftdetail' eftlead.id* %}*">{{
incident.eft_lead}}</a></td>
Behalf Of *Gregory Strydom
*Sent:* Wednesday, November 7, 2018 8:50 AM
*To:* Django users
*Subject:* Link ID's To Detail Page
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
<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>
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')
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
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
<https://groups.google.com/d/msgid/django-users/6ac26c7e-be21-468c-9146-25be6b28ee57%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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
<javascript:>.
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/84ef7752-b46d-4158-9128-b80fc58850e4%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/84ef7752-b46d-4158-9128-b80fc58850e4%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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/c876a2fd-9ab7-4963-a562-a5b9f7615478%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
vineeth sagar
2018-11-07 14:55:03 UTC
Permalink
I think it should be url 'kpi_detail' incident_id=incident.id" and for the
other one it should be url 'kpi_eftdetail' eftlead=eftlead.id" . I think
you get the idea. This won't solve it if you copy paste but it's a step in
the right path
Post by Gregory Strydom
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
<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>
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')
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
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
<https://groups.google.com/d/msgid/django-users/6ac26c7e-be21-468c-9146-25be6b28ee57%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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/CAMMZq8OVCN_ivJwDCzzX6yp1m%2Boy_0oLSdAsMcvQThwXQioc3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Gregory Strydom
2018-11-07 15:05:29 UTC
Permalink
That is pretty much the way I have it set up yeah so I also think it should
work but its not.

I did have a closer look at the No_Reverse error and saw this:

Reverse for 'kpi_eftdetail' with arguments '(",)' not found. 1 pattern(s)
tried: ['kpi/eftlead/(?P<eftlead_id>\\d+$']

I think the '(",)' is the clue. I do not think it is matching correctly
because the id is not coming through.
Post by vineeth sagar
I think it should be url 'kpi_detail' incident_id=incident.id" and for
the other one it should be url 'kpi_eftdetail' eftlead=eftlead.id" . I
think you get the idea. This won't solve it if you copy paste but it's a
step in the right path
Post by Gregory Strydom
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
<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>
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')
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
<javascript:>.
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
<https://groups.google.com/d/msgid/django-users/6ac26c7e-be21-468c-9146-25be6b28ee57%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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/9815a253-c159-4ed8-aece-c445a23b88b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...