~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/views/search.py

  • Committer: Tarmac
  • Author(s): Brad Crittenden
  • Date: 2013-08-01 20:59:27 UTC
  • mfrom: (325.1.9 bundle-search)
  • Revision ID: tarmac-20130801205927-lcbxxxb2bba92akt
[r=abentley][bug=][author=bac] Provide support for bundles in searching. The display of search results in the web app still only shows charms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
from webob import Response
9
9
 
10
10
from charmworld.search import (
 
11
    CHARM,
11
12
    IndexNotReady,
12
13
    SearchServiceNotAvailable,
13
14
)
45
46
        data = do_search(request)
46
47
    except (IndexNotReady, SearchServiceNotAvailable):
47
48
        return json_response(503, {'type': 'search_not_ready'})
48
 
    results = data['results']
 
49
    data['charm_total'] = data.pop('result_total')
 
50
    results = data['results'][CHARM]
49
51
    charms = []
50
52
    for r in results:
51
53
        charm = r['data']