~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/models.py

[r=benji][bug=][author=sinzui] Update IndexClient.api_search to include the doctype of the found document.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    read_locked,
34
34
    quote_key,
35
35
)
36
 
from charmworld.search import ElasticSearchClient
 
36
from charmworld.search import (
 
37
    CHARM,
 
38
    ElasticSearchClient,
 
39
)
37
40
from charmworld.jobs.config import settings
38
41
 
39
42
OBSOLETE_SERIES = set(['oneiric'])
264
267
        # There is no query, so there are no featured items.
265
268
        if query is None:
266
269
            return []
267
 
        return list(_find_charms(collection,
268
 
                    self._make_featured_query(doctype)))
 
270
        return [
 
271
            dict(doctype=CHARM, data=featured)
 
272
            for featured in _find_charms(collection, query)]
269
273
 
270
274
 
271
275
class Charm: