Mochinov

Untitled

Feb 26th, 2021 (edited)
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. class SearchFilter(LoginRequiredMixin, generic.ListView):
  2.     def get_queryset(self):
  3.         if self.request.method == 'GET':
  4.             chek_box = self.request.GET.get('chek_box', None).strip()
  5.  
  6.         """"Код фильтра """
  7.         if check_box:
  8.             models = your_model_one
  9.         else:
  10.             models = your_model_two
  11.         return models
Add Comment
Please, Sign In to add comment