Default media looks in path, descr, and mime type

svn: r20043
This commit is contained in:
Doug Blank 2012-07-21 22:22:32 +00:00
parent b5bf4a3644
commit ea9a8699f7

View File

@ -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