I have ListView where i display some results on my website and i have search parameter which gives the result based on title and number here i should ignore the exact spelling and show the results for both i.e search criterion to be able to ignore "." "et al." and similar terms so that when searching titles the name doesn't have to be exact. I.E. "Toaster v fridge" will still bring up "Toaster, et al. v. Fridge"
class MyListAPIView(ListAPIView): def get_filters(self, request): filters = [] id_list = request.query_params.getlist('id[]', []) if id_list: filters.append(Q(id__in=id_list)) return filters search = request.query_params.get('search', '') if search: filters.append(Q(c_number__icontains=search) | Q(title__icontains=search)) return filters -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ae754e29-a767-4b40-949c-3b0d7aa45ec0n%40googlegroups.com.