On Fri, Mar 16, 2012 at 04:29, Shawn Milochik <sh...@milochik.com> wrote:
> Look at how the Q objects are being used in the example and it's clear why
> that is. It's using the pipe (|) to do an "or" query.
>
> If you want to change how the search works you'll have to add more code:
>
> 1. Split the search parameters on whitespace.
> 2. Create Q objects for searching in either or both fields for the values
> and use pipe (|) and ampersand (&) to "or" or "and" them as needed.
>

Maybe this code will help you forward:

https://github.com/matthiask/towel/blob/master/towel/managers.py

It supports grouping ("term1 term2"), inclusion ("term" or "+term")
and exclusion ("-term") too.


Matthias

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to