gallery limit removed - it will be added with paging

This commit is contained in:
zalun 2010-03-04 11:41:41 +00:00
Родитель 7b30504b2e
Коммит 81999333d2
1 изменённых файлов: 5 добавлений и 4 удалений

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

@ -10,13 +10,14 @@ from base.shortcuts import get_object_or_create
from jetpack.models import Jet, JetVersion, Cap, CapVersion from jetpack.models import Jet, JetVersion, Cap, CapVersion
from jetpack.default_settings import settings from jetpack.default_settings import settings
def gallery(r, page=None): def gallery(r, page=None, with_new=False):
""" """
Display mixed list (Jetpacks with Capabilities) Display mixed list (Jetpacks with Capabilities)
""" """
items = list(Jet.objects.all()[0:20]) items = list(Jet.objects.all())
items.extend(list(Cap.objects.all()[0:20])) items.extend(list(Cap.objects.all()))
items = filter(lambda i: i.base_version, items) if not with_new:
items = filter(lambda i: i.base_version, items)
items.sort(lambda i, j: (j.base_version.last_update - i.base_version.last_update).seconds) items.sort(lambda i, j: (j.base_version.last_update - i.base_version.last_update).seconds)
page = "packages" page = "packages"