Re: Query exclude in and selective sort questions

2009-04-25 Thread Malcolm Tredinnick
On Thu, 2009-04-16 at 18:20 -0700, Thierry wrote: > Let's say I have a list of words in my database: > > ['bbb', 'aaa', 'zzz', 'ddd'] > > How can I retrieve a list of the above excluding the following words > ['aaa', 'zzz'] by using __in? I can do the above with: > >words_list = Words.obje

Query exclude in and selective sort questions

2009-04-16 Thread Thierry
Let's say I have a list of words in my database: ['bbb', 'aaa', 'zzz', 'ddd'] How can I retrieve a list of the above excluding the following words ['aaa', 'zzz'] by using __in? I can do the above with: words_list = Words.objects.exclude( Q(word_name = 'aaa') | Q(word_name = 'zzz')