當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。