Re: Multiple icontains using OR - Is it possible?

2010-01-21 Thread tm
This worked! Thank you On Dec 15 2009, 11:27 pm, HARRY POTTRER wrote: > you're going to need the Q object, it seems. > > from django.db.models import Q > MyModel.objects.filter(Q(summary__icontains=q) | Q > (title__icontains=q)) > > On Dec 15, 10:32 pm, tm

Re: Multiple icontains using OR - Is it possible?

2009-12-15 Thread HARRY POTTRER
you're going to need the Q object, it seems. from django.db.models import Q MyModel.objects.filter(Q(summary__icontains=q) | Q (title__icontains=q)) On Dec 15, 10:32 pm, tm wrote: > Hello Django Users, > > I'm trying to use icontains to check 2 fields in the same table for

Multiple icontains using OR - Is it possible?

2009-12-15 Thread tm
Hello Django Users, I'm trying to use icontains to check 2 fields in the same table for a keyword entered into a search. ex I've tried: queryset = MyModel.objects.filter(summary__icontains=q).filter (title__icontains=q) and queryset = MyModel.objects.filter(summary__icontains=q,