use Addon.featured_random for features (bug 643232)

This commit is contained in:
Jeff Balogh 2011-03-25 12:48:55 -07:00
Родитель 76ae626921
Коммит a793ca95ba
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -18,6 +18,7 @@ from caching.base import cached_with
import amo
import api
from api.utils import addon_to_dict
from amo.models import manual_order
from amo.urlresolvers import get_url_prefix
from amo.utils import JSONEncoder
from addons.models import Addon
@ -284,7 +285,9 @@ class ListView(APIView):
.order_by('-hotness'))[:limit + BUFFER]
shuffle = False
else:
addons = Addon.objects.featured(APP) & qs
ids = Addon.featured_random(APP, self.request.LANG)
addons = manual_order(qs, ids[:limit + BUFFER], 'addons.id')
shuffle = False
args = (addon_type, limit, APP, platform, version, shuffle)
f = lambda: self._process(addons, *args)