(School) Detail View Not Work

31 views
Skip to first unread message

Parvez Khan Pathan

unread,
Dec 9, 2019, 8:44:01 AM12/9/19
to Django users

Not Look Like This : which is not possible to click[Link] at Fist School

detailViewBug.png

Its could be look like this which means click on Fist School and Its Show Detail Of Schools

detailView.png


Amitesh Sahay

unread,
Dec 9, 2019, 1:20:28 PM12/9/19
to Django users
try the below and see if that works, I havn't tried that though.


class SchoolDetailView(request):
    context_object_name = 'school_detail'
    template_name = 'basic_app/school_detail.html'
    return render(request, template_name)

I don't think you need to declare the model in this class, as you are not getting any data from the database, you are simply rendering the html page.

Regards,
Amitesh


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5811ef71-fb70-4215-a578-fc3550cccca2%40googlegroups.com.

Dominick Del Ponte

unread,
Dec 9, 2019, 9:19:54 PM12/9/19
to django...@googlegroups.com
I think the issue is in your school_list.html

specifically this line:
<h2><li><a href="{{school.id}}"></a>{{school.name}}</li></h2> 

Just move the </a> to after {{ school.name }}. The issue is that your link has no content to click on.

Parvez Khan Pathan

unread,
Dec 10, 2019, 2:52:32 AM12/10/19
to django...@googlegroups.com

Thanks Dominick

Its work!

 

Thank you so much for your response and help as well.

 

Sent from Mail for Windows 10

 


From: django...@googlegroups.com <django...@googlegroups.com> on behalf of Dominick Del Ponte <delpon...@gmail.com>
Sent: Tuesday, December 10, 2019 7:48:32 AM
To: django...@googlegroups.com <django...@googlegroups.com>
Subject: Re: (School) Detail View Not Work
 

Parvez Khan Pathan

unread,
Dec 10, 2019, 2:53:52 AM12/10/19
to django...@googlegroups.com

Thanks for response  Amitesh,

 

Surely keep in mind your advise…

I tried solution by Dominick and its work for me.

Again thanks for response sir.

 

Sent from Mail for Windows 10

 

From: 'Amitesh Sahay' via Django users
Sent: Monday, 09 December 2019 23:50
To: Django users
Subject: Re: (School) Detail View Not Work

 

try the below and see if that works, I havn't tried that though.

 

 

class SchoolDetailView(request):
    context_object_name = 'school_detail'
    template_name = 'basic_app/school_detail.html'
    return render(request, template_name)

 

I don't think you need to declare the model in this class, as you are not getting any data from the database, you are simply rendering the html page.

 

Regards,

Amitesh

 

 

On Monday, 9 December, 2019, 7:14:53 pm IST, Parvez Khan Pathan <iamparv...@gmail.com> wrote:

 

 

 

Not Look Like This : which is not possible to click[Link] at Fist School

 

Its could be look like this which means click on Fist School and Its Show Detail Of Schools

 

 

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5811ef71-fb70-4215-a578-fc3550cccca2%40googlegroups.com.

--
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.

Reply all
Reply to author
Forward
0 new messages