Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
At least two solutions. One is to write the desired status in the url, the other is to pass it as a GET parameter.
In the first case it will be like this:
# в urls.py
# ...
url('^mypage/(?P<status_num>[1-3])$', ClientListView.as_view()),
# ...
# в views.py
class ClientListView(ClientTemplateListView):
def get_queryset(self,):
self.client = Client.objects.filter(status=self.kwargs['status_num'])
return self.client
class ClientListView(ClientTemplateListView):
def get_queryset(self,):
self.client = Client.objects.filter(status=self.request.GET.get('status_num'))
return self.client
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question