-from catalogue import models
-from catalogue import forms
-from catalogue.utils import split_tags
-
-
-def catalogue_redirect(request, tags=''):
- if len(request.GET['q']) > 0:
+def search(request):
+ query = request.GET.get('q', '')
+ tags = request.GET.get('tags', '')
+ if tags == '':
+ tags = []
+
+ try:
+ tag_list = models.Tag.get_tag_list(tags)
+ tag = models.Tag.objects.get(name=query)
+ except models.Tag.DoesNotExist: