Hi, I've a problem with paginate in CBV using a form search to filter results.
When I get "page 2" (in paginator) the object_list (filtered by name example) load all data again. I've a object with 20 records, so I get a search and returned 12 records (paginate_by=2) generate 2 pages. But when I go to the page 2 my object get again all 20 records I'd like to "persist" the object My View: class EstadoListView(LoginRequiredMixin, ListView): model = Estado context_object_name = 'estados' paginate_by = settings.PAGINATE_BY template_name = 'estado_list.html' def post(self, request, *args, **kwargs): pesquisa = self.request.POST['keyword'] self.object_list = Estado.objects.pesquisa(pesquisa) #filtering the object return self.render_to_response(self.get_context_data(object_list=self.object_list)) def get_queryset(self): result = super(EstadoListView, self).get_queryset() if self.request.POST.get('keyword'): pesquisa = self.request.POST.get('keyword') else: pesquisa = None if pesquisa: result = Estado.objects.pesquisa(pesquisa) return result My form (template): <form method="post" class="form-inline" action=".">{% csrf_token %} <div class="input-group"> <div class="input-cont"> <input type="text" name="keyword" placeholder="Digite para pesquisar..." class="form-control"/> </div> <span class="input-group-btn"> <button type="submit" class="btn green-meadow"> Pesquisar <i class="m-icon-swapright m-icon-white"></i> </button> </span> </div> </form> Thank's a lot Regards, Flaudizio Filho -- 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 post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/64532487-5865-481a-ac49-26c46335e129%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.