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


Python DndMobilePaginator.items方法代码示例

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


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

示例1: race_list_by_rulebook_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def race_list_by_rulebook_mobile(request):
    rulebook_list = Rulebook.objects.select_related('dnd_edition').all()

    paginator = DndMobilePaginator(rulebook_list, request)

    return render(request, 'dnd/mobile/races/race_list_by_rulebook.html', context=
      {'rulebook_list': paginator.items(), 'paginator': paginator,},)
开发者ID:dndtools2,项目名称:dndtools2,代码行数:9,代码来源:views.py

示例2: edition_list_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def edition_list_mobile(request):
    edition_list = DndEdition.objects.all()

    paginator = DndMobilePaginator(edition_list, request)

    return render(request, 'dnd/mobile/rulebooks/edition_list.html', context={
      'edition_list': paginator.items(), 'paginator': paginator,},)
开发者ID:dndtools2,项目名称:dndtools2,代码行数:9,代码来源:views.py

示例3: feat_category_list_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def feat_category_list_mobile(request):
    feat_category_list = FeatCategory.objects.all()

    paginator = DndMobilePaginator(feat_category_list, request)

    return render(request, 'dnd/mobile/feats/feat_category_list.html', context=
      {'feat_category_list': paginator.items(), 'paginator': paginator,},)
开发者ID:dndtools2,项目名称:dndtools2,代码行数:9,代码来源:views.py

示例4: spell_domain_detail_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def spell_domain_detail_mobile(request, spell_domain_slug, rulebook_slug=None, rulebook_id=None):
    # fetch the class
    spell_domain = get_object_or_404(Domain.objects.prefetch_related(
        'variant', 'variant__rulebook'), slug=spell_domain_slug)

    # fetch primary variant, this is independent of rulebook selected
    try:
        primary_variant = DomainVariant.objects.select_related('rulebook__dnd_edition',).prefetch_related('rulebook').filter(
            domain=spell_domain,
        ).order_by('-rulebook__dnd_edition__core', '-rulebook__published')[0]
    except Exception:
        primary_variant = None

    # if rulebook is supplied, select find this variant
    if rulebook_slug and rulebook_id:
        # use canonical link in head as this is more or less duplicated content
        use_canonical_link = True
        selected_variant = get_object_or_404(
            DomainVariant.objects.select_related('domain', 'rulebook__dnd_edition').prefetch_related('rulebook'),
            domain__slug=spell_domain_slug,
            rulebook__pk=rulebook_id)

        # possible malformed/changed slug
        if rulebook_slug != selected_variant.rulebook.slug:
            return permanent_redirect_object_mobile(request, selected_variant)

        # selected variant is primary! Redirect to canonical url
        if selected_variant == primary_variant:
            return permanent_redirect_view(
                request, spell_domain_detail, kwargs={
                    'spell_domain_slug': spell_domain_slug}
            )
    else:
        # this is canonical, no need to specify it
        use_canonical_link = False
        selected_variant = primary_variant

    other_variants = [
        variant
        for variant
        in spell_domain.variant.select_related('rulebook__dnd_edition', 'domain').prefetch_related('rulebook').all()
        if variant != selected_variant
    ]

    if selected_variant:
        display_3e_warning = is_3e_edition(selected_variant.rulebook.dnd_edition)
    else:
        display_3e_warning = False

    spell_list = spell_domain.spell_set.select_related('rulebook__dnd_edition', 'school').prefetch_related('rulebook').all()

    paginator = DndMobilePaginator(spell_list, request)

    return render(request, 'dnd/mobile/spells/spell_domain_detail.html', context={'spell_domain': spell_domain,
      'spell_list': paginator.items(), 'paginator': paginator, 'i_like_it_url': request.build_absolute_uri(),
      'inaccurate_url': request.build_absolute_uri(), 'selected_variant': selected_variant,
      'other_variants': other_variants, 'use_canonical_link': use_canonical_link,
      'display_3e_warning': display_3e_warning, },)
开发者ID:dndtools2,项目名称:dndtools2,代码行数:60,代码来源:views.py

示例5: spell_list_by_rulebook_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def spell_list_by_rulebook_mobile(request):
    rulebook_list = Rulebook.objects.select_related("dnd_edition").all()

    paginator = DndMobilePaginator(rulebook_list, request)

    return render_to_response(
        "dnd/mobile/spells/spell_list_by_rulebook.html",
        {"request": request, "rulebook_list": paginator.items(), "paginator": paginator},
        context_instance=RequestContext(request),
    )
开发者ID:ShivonQ,项目名称:dndtools,代码行数:12,代码来源:views.py

示例6: feat_category_list_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def feat_category_list_mobile(request):
    feat_category_list = FeatCategory.objects.all()

    paginator = DndMobilePaginator(feat_category_list, request)

    return render_to_response('dnd/mobile/feats/feat_category_list.html',
                              {
                                  'feat_category_list': paginator.items(),
                                  'paginator': paginator,
                                  'request': request, }, context_instance=RequestContext(request), )
开发者ID:FelixGV,项目名称:dndtools,代码行数:12,代码来源:views.py

示例7: language_index_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def language_index_mobile(request):
    f = LanguageFilter(request.GET, queryset=Language.objects.distinct())

    paginator = DndMobilePaginator(f.qs, request)

    form_submitted = 1 if '_filter' in request.GET else 0

    return render(request, 'dnd/mobile/languages/language_index.html', context=
      {'language_list': paginator.items(), 'paginator': paginator,
       'filter': f, 'form_submitted': form_submitted,},)
开发者ID:dndtools2,项目名称:dndtools2,代码行数:12,代码来源:views.py

示例8: edition_list_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def edition_list_mobile(request):
    edition_list = DndEdition.objects.all()

    paginator = DndMobilePaginator(edition_list, request)

    return render_to_response(
        "dnd/mobile/rulebooks/edition_list.html",
        {"edition_list": paginator.items(), "paginator": paginator, "request": request},
        context_instance=RequestContext(request),
    )
开发者ID:ShivonQ,项目名称:dndtools,代码行数:12,代码来源:views.py

示例9: feat_category_detail_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def feat_category_detail_mobile(request, category_slug):
    feat_category = get_object_or_404(FeatCategory, slug=category_slug)
    feat_list = feat_category.feat_set.select_related('rulebook',
                                                      'rulebook__dnd_edition').all()

    paginator = DndMobilePaginator(feat_list, request)

    return render(request, 'dnd/mobile/feats/feat_category_detail.html', context=
      {'feat_category': feat_category, 'feat_list': paginator.items(), 'paginator': paginator,
       'i_like_it_url': request.build_absolute_uri(), 'inaccurate_url': request.build_absolute_uri(), },)
开发者ID:dndtools2,项目名称:dndtools2,代码行数:12,代码来源:views.py

示例10: spell_school_detail_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def spell_school_detail_mobile(request, spell_school_slug):
    spell_school = get_object_or_404(SpellSchool, slug=spell_school_slug)

    spell_list = spell_school.spell_set.select_related('rulebook__dnd_edition', 'school').prefetch_related('rulebook').all()

    paginator = DndMobilePaginator(spell_list, request)

    return render(request, 'dnd/mobile/spells/spell_school_detail.html', context={'spell_school': spell_school,
      'spell_list': paginator.items(), 'paginator': paginator, 'i_like_it_url': request.build_absolute_uri(),
      'inaccurate_url': request.build_absolute_uri(), },)
开发者ID:dndtools2,项目名称:dndtools2,代码行数:12,代码来源:views.py

示例11: feat_index_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def feat_index_mobile(request):
    f = FeatFilter(request.GET, queryset=Feat.objects.select_related(
        'rulebook', 'rulebook__dnd_edition').distinct())

    form_submitted = 1 if '_filter' in request.GET else 0

    paginator = DndMobilePaginator(f.qs, request)

    return render(request, 'dnd/mobile/feats/feat_index.html', context={'feat_list': paginator.items(),
      'paginator': paginator, 'filter': f, 'form_submitted': form_submitted,},)
开发者ID:dndtools2,项目名称:dndtools2,代码行数:12,代码来源:views.py

示例12: skills_list_by_rulebook_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def skills_list_by_rulebook_mobile(request):
    rulebook_list = Rulebook.objects.select_related('dnd_edition').all()

    paginator = DndMobilePaginator(rulebook_list, request)

    return render_to_response('dnd/mobile/skills/skills_list_by_rulebook.html',
                              {
                                  'request': request,
                                  'rulebook_list': paginator.items(),
                                  'paginator': paginator,
                              }, context_instance=RequestContext(request), )
开发者ID:FelixGV,项目名称:dndtools,代码行数:13,代码来源:views.py

示例13: spell_descriptor_list_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def spell_descriptor_list_mobile(request):
    f = SpellDescriptorFilter(request.GET,
                              queryset=SpellDescriptor.objects.all())

    paginator = DndMobilePaginator(f.qs, request)

    form_submitted = 1 if '_filter' in request.GET else 0

    return render(request, 'dnd/mobile/spells/spell_descriptor_list.html', context=
      {'spell_descriptor_list': paginator.items(), 'paginator': paginator, 'filter': f,
       'form_submitted': form_submitted,},)
开发者ID:dndtools2,项目名称:dndtools2,代码行数:13,代码来源:views.py

示例14: rulebook_list_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def rulebook_list_mobile(request):
    f = RulebookFilter(request.GET, queryset=Rulebook.objects.select_related(
        'dnd_edition'))

    form_submitted = 1 if '_filter' in request.GET else 0

    paginator = DndMobilePaginator(f.qs, request)

    return render(request, 'dnd/mobile/rulebooks/rulebook_list.html', context={
      'rulebook_list': paginator.items(), 'paginator': paginator, 'filter': f,
      'form_submitted': form_submitted,},)
开发者ID:dndtools2,项目名称:dndtools2,代码行数:13,代码来源:views.py

示例15: edition_detail_mobile

# 需要导入模块: from dnd.mobile.dnd_paginator import DndMobilePaginator [as 别名]
# 或者: from dnd.mobile.dnd_paginator.DndMobilePaginator import items [as 别名]
def edition_detail_mobile(request, edition_slug, edition_id):
    dnd_edition = get_object_or_404(DndEdition, id=edition_id)
    if dnd_edition.slug != edition_slug:
        return permanent_redirect_object_mobile(request, dnd_edition)

    rulebook_list = dnd_edition.rulebook_set.select_related('dnd_edition').all()

    paginator = DndMobilePaginator(rulebook_list, request)

    return render(request, 'dnd/mobile/rulebooks/edition_detail.html', context=
      {'dnd_edition': dnd_edition, 'rulebook_list': paginator.items(), 'paginator': paginator,
       'i_like_it_url': request.build_absolute_uri(), 'inaccurate_url': request.build_absolute_uri(),
       'display_3e_warning': is_3e_edition(dnd_edition),},)
开发者ID:dndtools2,项目名称:dndtools2,代码行数:15,代码来源:views.py


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