Have you tried using the *.query* on Django's QuerySet (documentation: [1])
For example, if my QuerySet is:
*User.objects.filter(username__contains='alpha')*
I can obtain the underlying raw SQL Query using:
*print(User.objects.filter(username__contains='alpha').query)*
*>>> *print(User.objects.fi
I now how to use django pagination with ORM django after filtering the
required data and put in into *pagination div*
*queryset_list = employee.objects.all()*
*query=request.GET.get("q")*
*if query:*
*queryset_list=queryset_list.filter(*
* Q(name__icontains=query)
2 matches
Mail list logo