You can use the DetailListView from generic views.
Pass in the template name, form class, and query(which in this case takes
in the slug to query the db)


On Mon, Nov 15, 2021, 21:27 Aadil Rashid <aadil10121...@gmail.com> wrote:

> Hello my dear Friends, I have a question regarding Class Based Views.
>
> If we have a url e.g,
> path('item/<str:slug>/',  views.funView)
>
> We can handle it in  Function Based Views,
> By simply
> def funView(request, slug) :
>        #logic
>        return render(request, "tempName")
>
>
> We can even pass this slug as a context in this template,
>
>
> My question is how can we achieve this by using class Based Views.
>
>
> Thanks in advance.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAYXZx_Sn2BBhPWZXi_zEECN-x7wu9sDQJfYeVH31oHhemptpQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAAYXZx_Sn2BBhPWZXi_zEECN-x7wu9sDQJfYeVH31oHhemptpQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANMtYSTrHPFaGsmPqp8w6PhPUbxTiU_u8qxvqLQj%2BoJ3O_eZdA%40mail.gmail.com.

Reply via email to