Neither work, although judging by the docs the second one shouldn't in
this case. Has anyone successfully searched a MySQL DB using
icontains on 2 filelds in the same model? Any help greatly
appreciated :)
T
HARRY POTTRER
unread,
Dec 15, 2009, 11:27:35 PM12/15/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
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))
tm
unread,
Jan 21, 2010, 9:02:39 PM1/21/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message