{'continents': continents, 'countries': countries,
'ethnic_groups': ethnic_groups})
- def search(self, request, type = 'items'):
+ def search(self, request, type = None):
"""Perform a search through collections and items metadata"""
collections = MediaCollection.objects.all()
items = MediaItem.objects.all()
collections, items = func(value)
criteria[key] = value
+ if type is None:
+ if collections.count() and not items.count():
+ type = 'collections'
+ else:
+ type = 'items'
+
if type == 'items':
objects = items
else: