当前位置: 首页>>代码示例>>Python>>正文


Python Webapp.popular方法代码示例

本文整理汇总了Python中mkt.webapps.models.Webapp.popular方法的典型用法代码示例。如果您正苦于以下问题:Python Webapp.popular方法的具体用法?Python Webapp.popular怎么用?Python Webapp.popular使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mkt.webapps.models.Webapp的用法示例。


在下文中一共展示了Webapp.popular方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _landing

# 需要导入模块: from mkt.webapps.models import Webapp [as 别名]
# 或者: from mkt.webapps.models.Webapp import popular [as 别名]
def _landing(request, category=None):
    if category:
        category = get_object_or_404(Category.objects.filter(type=amo.ADDON_WEBAPP, weight__gte=0), slug=category)
        featured = Webapp.featured(category)
        popular = Webapp.popular().filter(category=category.id)
    else:
        popular = Webapp.popular()
        featured = Webapp.featured(None)

    return jingo.render(
        request, "browse/landing.html", {"category": category, "featured": featured[:6], "popular": popular[:6]}
    )
开发者ID:sjhewitt,项目名称:zamboni,代码行数:14,代码来源:views.py

示例2: _landing

# 需要导入模块: from mkt.webapps.models import Webapp [as 别名]
# 或者: from mkt.webapps.models.Webapp import popular [as 别名]
def _landing(request, category=None):
    region = getattr(request, 'REGION', mkt.regions.WORLDWIDE)
    if category:
        category = get_object_or_404(
            Category.objects.filter(type=amo.ADDON_WEBAPP, weight__gte=0),
            slug=category)
        featured = Webapp.featured(cat=category, region=region)
        popular = _add_mobile_filter(request,
            Webapp.popular(cat=category, region=region))
    else:
        popular = _add_mobile_filter(request, Webapp.popular(region=region))
        featured = Webapp.featured(region=region)

    return jingo.render(request, 'browse/landing.html', {
        'category': category,
        'featured': featured[:6],
        'popular': popular[:6]
    })
开发者ID:lauraxt,项目名称:zamboni,代码行数:20,代码来源:views.py

示例3: home

# 需要导入模块: from mkt.webapps.models import Webapp [as 别名]
# 或者: from mkt.webapps.models.Webapp import popular [as 别名]
def home(request):
    """The home page."""
    if not getattr(request, 'can_view_consumer', True):
        return jingo.render(request, 'home/home_walled.html')
    featured = Webapp.featured('home')[:3]
    popular = Webapp.popular()[:6]
    return jingo.render(request, 'home/home.html', {
        'featured': featured,
        'popular': popular
    })
开发者ID:gkoberger,项目名称:zamboni,代码行数:12,代码来源:views.py

示例4: home

# 需要导入模块: from mkt.webapps.models import Webapp [as 别名]
# 或者: from mkt.webapps.models.Webapp import popular [as 别名]
def home(request):
    """The home page."""
    if not getattr(request, 'can_view_consumer', True):
        return jingo.render(request, 'home/home_walled.html')
    region = getattr(request, 'REGION', mkt.regions.WORLDWIDE)
    featured = Webapp.featured(region=region, cat=None)[:9]
    popular = _add_mobile_filter(request, Webapp.popular(region=region))[:10]
    latest = _add_mobile_filter(request, Webapp.latest(region=region))[:10]
    return jingo.render(request, 'home/home.html', {
        'featured': featured,
    })
开发者ID:Sancus,项目名称:zamboni,代码行数:13,代码来源:views.py

示例5: home

# 需要导入模块: from mkt.webapps.models import Webapp [as 别名]
# 或者: from mkt.webapps.models.Webapp import popular [as 别名]
def home(request):
    """The home page."""
    if not getattr(request, 'can_view_consumer', True):
        return jingo.render(request, 'home/home_walled.html')
    featured = Webapp.featured(cat=None)
    popular = Webapp.popular()[:10]
    latest = Webapp.latest()[:10]
    return jingo.render(request, 'home/home.html', {
        'featured': featured,
        'popular': popular,
        'latest': latest
    })
开发者ID:,项目名称:,代码行数:14,代码来源:

示例6: _landing

# 需要导入模块: from mkt.webapps.models import Webapp [as 别名]
# 或者: from mkt.webapps.models.Webapp import popular [as 别名]
def _landing(request, category=None):
    featured = Webapp.featured('category')
    popular = Webapp.popular()

    if category:
        category = get_object_or_404(
            Category.objects.filter(type=amo.ADDON_WEBAPP, weight__gte=0),
            slug=category)
        featured = featured.filter(category=category)[:6]
        popular = popular.filter(category=category.id)

    return jingo.render(request, 'browse/landing.html', {
        'category': category,
        'featured': featured[:6],
        'popular': popular[:6]
    })
开发者ID:gkoberger,项目名称:zamboni,代码行数:18,代码来源:views.py

示例7: test_disable_paid_popular_apps

# 需要导入模块: from mkt.webapps.models import Webapp [as 别名]
# 或者: from mkt.webapps.models.Webapp import popular [as 别名]
 def test_disable_paid_popular_apps(self):
     eq_(list(Webapp.popular(region=mkt.regions.WORLDWIDE)), [])
开发者ID:,项目名称:,代码行数:4,代码来源:


注:本文中的mkt.webapps.models.Webapp.popular方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。