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
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
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,
3 matches
Mail list logo