Issue
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...
Solution
I changed basepage html charset=ISO-8859-8
and it helped.
Answered By - SS_SS
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.