Ok, I will follow with exemplary code similar to the one i use:
<code>
...
searchquery = request.GET["q"]
complete_query = ~Q(pk__in=[])  # this should be something like Q.ident()
            for query in search_query.split():
                complete_query &= (
                    Q(autor__first_name__icontains=query) |
                    Q(author__last_name__icontains=query) |
                    Q(title__icontains=query) |
                    Q(year=int(query) if query.isdigit() else -1)
                )
            books = Book.obejects.filter(complete_query).distinct() # the 
distinct is for the issue described in the PPS

... # render page with the filtered books
</code>

in the Example the searchquery is a string of features seperated by 
whitespaces the user wants to search for and the Book model is similar to 
the one described in the django tutorials, if I remember them right.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/4ee7d03e-3c19-4fab-bf8b-4624fbdb9da5n%40googlegroups.com.

Reply via email to