On Wed, 2011-06-15 at 20:28 -0700, Bobby Roberts wrote:
> consider this:
>
> findit = inventory.objects.filter(Barcode = self.Barcode,
> Condition__name = "good")
>
> How could i make this filter say "good" or "acceptable"
.filter(Q(Condition__name='good') | Q(Condition__name='acceptable'))
>
consider this:
findit = inventory.objects.filter(Barcode = self.Barcode,
Condition__name = "good")
How could i make this filter say "good" or "acceptable"
or IN ('good','acceptable')
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
Strike all that, I made a mistake which is very clear on the test case
but wasn't so in the original code.
Philippe
On 9 juin, 18:00, Philippe Raoult wrote:
> Hello all,
>
> I've been hunting for a bug in my generic search form and it boils
> down to this: I (wrongly) expected chained filters
Hello all,
I've been hunting for a bug in my generic search form and it boils
down to this: I (wrongly) expected chained filters to behave as if
they were AND'd and they sometimes behave as OR'd. That was a bit
puzzling for me since the documentation seems to indicate that AND
would be the logica
4 matches
Mail list logo