From ea9a8699f7a030429f1a501da2def278d57991cb Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 21 Jul 2012 22:22:32 +0000 Subject: [PATCH] Default media looks in path, descr, and mime type svn: r20043 --- src/webapp/grampsdb/views.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/webapp/grampsdb/views.py b/src/webapp/grampsdb/views.py index c7611a2ac..67db7bf9b 100644 --- a/src/webapp/grampsdb/views.py +++ b/src/webapp/grampsdb/views.py @@ -727,9 +727,15 @@ def build_media_query(request, search): request.user.message_set.create(message="Invalid query field '%s'" % field) else: # no search fields, just raw search if protect: - query &= Q(gramps_id__icontains=search) + query &= (Q(gramps_id__icontains=search) | + Q(path__icontains=search) | + Q(desc__icontains=search) | + Q(mime__icontains=search)) else: - query &= Q(gramps_id__icontains=search) + query &= (Q(gramps_id__icontains=search) | + Q(path__icontains=search) | + Q(desc__icontains=search) | + Q(mime__icontains=search)) else: # no search pass # nothing left to do return query, order, terms