Django query filtering in paginated search_view

Question:

I have an issue to filter my queryset with following view:

def innovation_search_result_view(request, *args, **kwargs):
    
    context = {}

    searched = ''

    # Search
    
    if request.GET:

        searched = request.GET.get('eWords', '')
        

        context['searched'] = searched

    lookup=(Q(ttg__icontains=searched))

    searched_innovations = Innovationdb.objects.filter(lookup)
    searched_items = searched_innovations.count()

    
    # Pagination
        
    page = request.GET.get('page', 1)

    p = Paginator(searched_innovations, 50)

    try:
        searched_innovations = p.page(page)

    except PageNotAnInteger:
        searched_innovations = p.page(10)

    except EmptyPage:
        searched_innovations = p.page(p.num_pages)
    
    return render(request, 'web_page/innovation-search-result.html', {'searched':searched, 'searched_items':searched_items, 'searched_innovations':searched_innovations})

I just do not understand why it does not do a trick. It simply renders full list of instances.

Any hints please…

Asked By: SS_SS

||

Answers:

I changed basepage html charset=ISO-8859-8 and it helped.

Answered By: SS_SS