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


Python DndPaginator.items方法代码示例

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


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

示例1: spell_index

# 需要导入模块: from dndtools.dnd.dnd_paginator import DndPaginator [as 别名]
# 或者: from dndtools.dnd.dnd_paginator.DndPaginator import items [as 别名]
def spell_index(request):
    if is_admin(request):
        f = SpellFilterAdmin(
            request.GET,
            queryset=Spell.objects.select_related(
                "rulebook", "rulebook__dnd_edition", "school", "verified_author"
            ).distinct(),
        )
    else:
        f = SpellFilter(
            request.GET, queryset=Spell.objects.select_related("rulebook", "rulebook__dnd_edition", "school").distinct()
        )

    paginator = DndPaginator(f.qs, request)

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

    return render_to_response(
        "dnd/spells/spell_index.html",
        {
            "request": request,
            "spell_list": paginator.items(),
            "paginator": paginator,
            "filter": f,
            "form_submitted": form_submitted,
        },
        context_instance=RequestContext(request),
    )
开发者ID:illiptic,项目名称:dndtools,代码行数:30,代码来源:views.py

示例2: edition_detail

# 需要导入模块: from dndtools.dnd.dnd_paginator import DndPaginator [as 别名]
# 或者: from dndtools.dnd.dnd_paginator.DndPaginator import items [as 别名]
def edition_detail(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(request, dnd_edition)

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

    paginator = DndPaginator(rulebook_list, request)

    if is_3e_edition(dnd_edition):
        request.submenu_item = MenuItem.Rulebooks.BOOKS_3_0
    elif dnd_edition.slug == "core-35":
        request.submenu_item = MenuItem.Rulebooks.CORE_3_5
    elif dnd_edition.slug == "supplementals-35":
        request.submenu_item = MenuItem.Rulebooks.SUPPLEMENTS_3_5
    elif dnd_edition.slug == "dragonlance":
        request.submenu_item = MenuItem.Rulebooks.DRAGONLANCE_3_5
    elif dnd_edition.slug == "eberron-35":
        request.submenu_item = MenuItem.Rulebooks.EBERRON_3_5
    elif dnd_edition.slug == "forgotten-realms-35":
        request.submenu_item = MenuItem.Rulebooks.FORGOTTEN_REALMS_3_5

    return render_to_response('dnd/rulebooks/edition_detail.html',
                              {
                                  'dnd_edition': dnd_edition,
                                  'request': request,
                                  '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),
                              }, context_instance=RequestContext(request), )
开发者ID:Jellinek-86,项目名称:dndtools,代码行数:34,代码来源:views.py

示例3: feat_category_list

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

    paginator = DndPaginator(feat_category_list, request)

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

示例4: race_list_by_rulebook

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

    paginator = DndPaginator(rulebook_list, request)

    return render_to_response('dnd/race_list_by_rulebook.html',
            {'request': request,
             'rulebook_list': paginator.items(),
             'paginator': paginator,
             }, context_instance=RequestContext(request), )
开发者ID:Aaron-M-Hill,项目名称:dndtools,代码行数:12,代码来源:views.py

示例5: edition_list

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

    paginator = DndPaginator(edition_list, request)

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

示例6: item_list_by_rulebook

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

    paginator = DndPaginator(rulebook_list, request)

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

示例7: skill_list

# 需要导入模块: from dndtools.dnd.dnd_paginator import DndPaginator [as 别名]
# 或者: from dndtools.dnd.dnd_paginator.DndPaginator import items [as 别名]
def skill_list(request):
    f = SkillFilter(request.GET, queryset=Skill.objects.all())

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

    paginator = DndPaginator(f.qs, request)

    return render_to_response('dnd/skill_list.html',
            {'request': request,
             'skill_list': paginator.items(),
             'paginator': paginator,
             'filter': f,
             'form_submitted': form_submitted,
             }, context_instance=RequestContext(request), )
开发者ID:Aaron-M-Hill,项目名称:dndtools,代码行数:16,代码来源:views.py

示例8: feat_category_detail

# 需要导入模块: from dndtools.dnd.dnd_paginator import DndPaginator [as 别名]
# 或者: from dndtools.dnd.dnd_paginator.DndPaginator import items [as 别名]
def feat_category_detail(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 = DndPaginator(feat_list, request)

    return render_to_response('dnd/feat_category_detail.html',
            {'feat_category': feat_category,
             'feat_list': paginator.items(),
             'paginator': paginator,
             'request': request,
             'i_like_it_url': request.build_absolute_uri(),
             'inaccurate_url': request.build_absolute_uri(), }, context_instance=RequestContext(request), )
开发者ID:Aaron-M-Hill,项目名称:dndtools,代码行数:16,代码来源:views.py

示例9: rulebook_list

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

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

    paginator = DndPaginator(f.qs, request)

    return render_to_response('dnd/rulebook_list.html',
            {'request': request,
             'rulebook_list': paginator.items(),
             'paginator': paginator,
             'filter': f,
             'form_submitted': form_submitted,
             }, context_instance=RequestContext(request), )
开发者ID:Aaron-M-Hill,项目名称:dndtools,代码行数:17,代码来源:views.py

示例10: spell_school_detail

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

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

    paginator = DndPaginator(spell_list, request)

    return render_to_response('dnd/spell_school_detail.html',
            {'spell_school': spell_school,
             'spell_list': paginator.items(),
             'paginator': paginator,
             'request': request,
             'i_like_it_url': request.build_absolute_uri(),
             'inaccurate_url': request.build_absolute_uri(), }, context_instance=RequestContext(request), )
开发者ID:Aaron-M-Hill,项目名称:dndtools,代码行数:17,代码来源:views.py

示例11: item_index

# 需要导入模块: from dndtools.dnd.dnd_paginator import DndPaginator [as 别名]
# 或者: from dndtools.dnd.dnd_paginator.DndPaginator import items [as 别名]
def item_index(request):
    f = ItemFilter(request.GET, queryset=Item.objects.select_related(
        'rulebook', 'rulebook__dnd_edition').distinct())

    paginator = DndPaginator(f.qs, request)

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

    return render_to_response('dnd/item_index.html',
        {'request': request,
         'item_list': paginator.items(),
         'paginator': paginator,
         'filter': f,
         'form_submitted': form_submitted,
         }, context_instance=RequestContext(request), )
开发者ID:Aaron-M-Hill,项目名称:dndtools,代码行数:17,代码来源:views.py

示例12: language_index

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

    paginator = DndPaginator(f.qs, request)

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

    return render_to_response('dnd/languages/language_index.html',
                              {
                                  'request': request,
                                  'language_list': paginator.items(),
                                  'paginator': paginator,
                                  'filter': f,
                                  'form_submitted': form_submitted,
                              }, context_instance=RequestContext(request), )
开发者ID:Jellinek-86,项目名称:dndtools,代码行数:17,代码来源:views.py

示例13: deity_list

# 需要导入模块: from dndtools.dnd.dnd_paginator import DndPaginator [as 别名]
# 或者: from dndtools.dnd.dnd_paginator.DndPaginator import items [as 别名]
def deity_list(request):
    f = DeityFilter(request.GET, queryset=Deity.objects.all())

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

    paginator = DndPaginator(f.qs, request)

    return render_to_response('dnd/deities/deity_list.html',
                              {
                                  'request': request,
                                  'deity_list': paginator.items(),
                                  'paginator': paginator,
                                  'filter': f,
                                  'form_submitted': form_submitted,
                              }, context_instance=RequestContext(request), )
开发者ID:DankilltheShadow,项目名称:dndtools,代码行数:17,代码来源:views.py

示例14: race_type_index

# 需要导入模块: from dndtools.dnd.dnd_paginator import DndPaginator [as 别名]
# 或者: from dndtools.dnd.dnd_paginator.DndPaginator import items [as 别名]
def race_type_index(request):
    f = RaceTypeFilter(request.GET, queryset=RaceType.objects.distinct())

    paginator = DndPaginator(f.qs, request)

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

    return render_to_response('dnd/races/race_type_index.html',
                              {
                                  'request': request,
                                  'race_type_list': paginator.items(),
                                  'paginator': paginator,
                                  'filter': f,
                                  'BaseSaveType': RaceType.BaseSaveType, # enums
                                  'BaseAttackType': RaceType.BaseAttackType, # enums
                                  'form_submitted': form_submitted,
                              }, context_instance=RequestContext(request), )
开发者ID:Jellinek-86,项目名称:dndtools,代码行数:19,代码来源:views.py

示例15: spell_descriptor_list

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

    paginator = DndPaginator(f.qs, request)

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

    return render_to_response(
        "dnd/spells/spell_descriptor_list.html",
        {
            "request": request,
            "spell_descriptor_list": paginator.items(),
            "paginator": paginator,
            "filter": f,
            "form_submitted": form_submitted,
        },
        context_instance=RequestContext(request),
    )
开发者ID:illiptic,项目名称:dndtools,代码行数:20,代码来源:views.py


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