What view in specific ?. If you refering to the "get_queryset" view if simple as.
from django.views.generic import View Class get_queryset(View): def get(self, request): """ Return the last five published questions (not including those set to be published in the future). """ return Question.objects.filter( pub_date__lte=timezone.now() ).order_by('-pub_date')[:5] On Mon, Dec 30, 2019 at 1:11 PM Moaaz Afzal <moaazafzal1...@gmail.com> wrote: > Thankyou for replying actually I want to change FBV to CBV in Django > Official Documentation Tutorial. > > https://docs.djangoproject.com/en/3.0/intro/tutorial05/ > > this one vote Function into CBV > > On Monday, December 30, 2019 at 8:49:58 PM UTC+5, Moaaz Afzal wrote: >> >> >> https://stackoverflow.com/questions/59510325/is-there-is-any-way-to-convert-this-fbv-to-cbv-in-polls-tutorial-of-djangotutori/59510529#59510529 >> actually I am trying this from Polls App in Django Doc. >> I am trying to do convert FBV to CBV Please help me. >> > -- > 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/a9c5236b-266e-4f8f-b566-573960fbb800%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/a9c5236b-266e-4f8f-b566-573960fbb800%40googlegroups.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/CADnnntaqhoFheoJvvDY2ddi179ZWEg3hwLSDL8WZRjCq_6Jxag%40mail.gmail.com.