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


Python menu.MenuItem方法代码示例

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


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

示例1: register_django_admin_menu_item

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_django_admin_menu_item():
    return MenuItem(_('Django Admin'), reverse('admin:index'),
                    classnames='icon icon-cogs', order=700) 
开发者ID:chrisdev,项目名称:wagtail-cookiecutter-foundation,代码行数:5,代码来源:wagtail_hooks.py

示例2: register_frank_menu_item

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_frank_menu_item():
    return MenuItem(
        'Oscar', reverse('dashboard:index'),
        classnames='icon icon-cogs', order=10000) 
开发者ID:labd,项目名称:django-oscar-wagtail,代码行数:6,代码来源:wagtail_hooks.py

示例3: test_menuitem_reverse_lazy_url_pass

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def test_menuitem_reverse_lazy_url_pass(self):
        menuitem = MenuItem(_('Test'), reverse_lazy('wagtailadmin_home'))
        self.assertEqual(menuitem.is_active(self.request), True) 
开发者ID:wagtail,项目名称:wagtail,代码行数:5,代码来源:tests.py

示例4: register_styleguide_menu_item

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_styleguide_menu_item():
    return MenuItem(
        _('Styleguide'),
        reverse('wagtailstyleguide'),
        icon_name='image',
        order=1000
    ) 
开发者ID:wagtail,项目名称:wagtail,代码行数:9,代码来源:wagtail_hooks.py

示例5: register_dashboard_menu_item

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_dashboard_menu_item():
    apply_home = ApplyHomePage.objects.first()
    return MenuItem(
        'Apply Dashboard',
        urljoin(apply_home.url, reverse('dashboard:dashboard', 'hypha.apply.urls')),
        classnames='icon icon-arrow-left',
        order=100000,
    ) 
开发者ID:OpenTechFund,项目名称:hypha,代码行数:10,代码来源:wagtail_hooks.py

示例6: register_500_menu_item

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_500_menu_item():
  return MenuItem('Generate 500', reverse('throw_error'), classnames='icon icon-warning', order=10000) 
开发者ID:openstax,项目名称:openstax-cms,代码行数:4,代码来源:wagtail_hooks.py

示例7: get_submenu_items

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def get_submenu_items(self):
        menu_items = []
        item_order = 1
        for modeladmin in self.modeladmin_instances:
            menu_items.append(modeladmin.get_menu_item(order=item_order))
            item_order += 1
        menu_items.append(MenuItem('Registrations', '/django-admin/events/registration/', classnames='icon icon-group', order=3000))
        return menu_items 
开发者ID:openstax,项目名称:openstax-cms,代码行数:10,代码来源:wagtail_hooks.py

示例8: register_errata_menu_item

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_errata_menu_item():
        return MenuItem('Errata', '/django-admin/errata/errata', classnames='icon icon-form', order=10000)

    # @hooks.register('register_admin_menu_item')
    # def register_errata_menu_item():
    #     return MenuItem('Errata (beta)', '/api/errata/admin/dashboard/', classnames='icon icon-form', order=10000) 
开发者ID:openstax,项目名称:openstax-cms,代码行数:8,代码来源:models.py

示例9: register_partner_menu_item

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_partner_menu_item():
        return MenuItem('Partners', '/django-admin/salesforce/partner/', classnames='icon icon-group', order=3000) 
开发者ID:openstax,项目名称:openstax-cms,代码行数:4,代码来源:models.py

示例10: register_styleguide_menu_item

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_styleguide_menu_item():
    return MenuItem(
        _('Analytics'),
        reverse('wagalytics_dashboard'),
        classnames='icon icon-fa-bar-chart',
        order=1000
    ) 
开发者ID:tomdyson,项目名称:wagalytics,代码行数:9,代码来源:wagtail_hooks.py

示例11: remove_menu_if_unverified

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def remove_menu_if_unverified(request, menu_items):
    """Remove the sidebar menu items if the user is unverified."""
    if (settings.WAGTAIL_2FA_REQUIRED and getattr(request.user, "enable_2fa", True)
            and not request.user.is_verified()):
        menu_items.clear()
        menu_items.append(MenuItem("2FA Setup", reverse('wagtail_2fa_device_list', kwargs={'user_id': request.user.id}))) 
开发者ID:labd,项目名称:wagtail-2fa,代码行数:8,代码来源:wagtail_hooks.py

示例12: register_images_menu_item

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_images_menu_item():
    return MenuItem(
        _('Videos'), reverse('wagtailvideos:index'),
        name='videos', classnames='icon icon-media', order=300
    ) 
开发者ID:neon-jungle,项目名称:wagtailvideos,代码行数:7,代码来源:wagtail_hooks.py

示例13: register_menu_settings

# 需要导入模块: from wagtail.admin import menu [as 别名]
# 或者: from wagtail.admin.menu import MenuItem [as 别名]
def register_menu_settings():
    return MenuItem(
        _('Link Checker'),
        urlresolvers.reverse('wagtaillinkchecker'),
        classnames='icon icon-link',
        order=300
    ) 
开发者ID:neon-jungle,项目名称:wagtail-linkchecker,代码行数:9,代码来源:wagtail_hooks.py


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