本文整理汇总了Python中treemenus.models.Menu.name方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.name方法的具体用法?Python Menu.name怎么用?Python Menu.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类treemenus.models.Menu
的用法示例。
在下文中一共展示了Menu.name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from treemenus.models import Menu [as 别名]
# 或者: from treemenus.models.Menu import name [as 别名]
def run():
from treemenus.models import Menu
treemenus_menu_1 = Menu()
treemenus_menu_1.name = u'root'
treemenus_menu_1.save()
treemenus_menu_2 = Menu()
treemenus_menu_2.name = u'persona'
treemenus_menu_2.save()
treemenus_menu_3 = Menu()
treemenus_menu_3.name = u'enfermeria'
treemenus_menu_3.save()
from treemenus.models import MenuItem
treemenus_menuitem_1 = MenuItem()
treemenus_menuitem_1.parent = None
treemenus_menuitem_1.caption = u'root'
treemenus_menuitem_1.url = u''
treemenus_menuitem_1.named_url = u''
treemenus_menuitem_1.level = 0
treemenus_menuitem_1.rank = 0
treemenus_menuitem_1.menu = treemenus_menu_1
treemenus_menuitem_1.save()
treemenus_menuitem_2 = MenuItem()
treemenus_menuitem_2.parent = None
treemenus_menuitem_2.caption = u'root'
treemenus_menuitem_2.url = u''
treemenus_menuitem_2.named_url = u''
treemenus_menuitem_2.level = 0
treemenus_menuitem_2.rank = 0
treemenus_menuitem_2.menu = treemenus_menu_2
treemenus_menuitem_2.save()
treemenus_menuitem_3 = MenuItem()
treemenus_menuitem_3.parent = treemenus_menuitem_1
treemenus_menuitem_3.caption = u'Enfermer\xeda'
treemenus_menuitem_3.url = u''
treemenus_menuitem_3.named_url = u'nightingale-index'
treemenus_menuitem_3.level = 1
treemenus_menuitem_3.rank = 4
treemenus_menuitem_3.menu = treemenus_menu_1
treemenus_menuitem_3.save()
treemenus_menuitem_4 = MenuItem()
treemenus_menuitem_4.parent = treemenus_menuitem_1
treemenus_menuitem_4.caption = u'Admisiones'
treemenus_menuitem_4.url = u''
treemenus_menuitem_4.named_url = u'admision-index '
treemenus_menuitem_4.level = 1
treemenus_menuitem_4.rank = 3
treemenus_menuitem_4.menu = treemenus_menu_1
treemenus_menuitem_4.save()
treemenus_menuitem_5 = MenuItem()
treemenus_menuitem_5.parent = treemenus_menuitem_1
treemenus_menuitem_5.caption = u'Examenes'
treemenus_menuitem_5.url = u''
treemenus_menuitem_5.named_url = u'examen-index '
treemenus_menuitem_5.level = 1
treemenus_menuitem_5.rank = 2
treemenus_menuitem_5.menu = treemenus_menu_1
treemenus_menuitem_5.save()
treemenus_menuitem_6 = MenuItem()
treemenus_menuitem_6.parent = treemenus_menuitem_1
treemenus_menuitem_6.caption = u'Inicio'
treemenus_menuitem_6.url = u''
treemenus_menuitem_6.named_url = u'home'
treemenus_menuitem_6.level = 1
treemenus_menuitem_6.rank = 0
treemenus_menuitem_6.menu = treemenus_menu_1
treemenus_menuitem_6.save()
treemenus_menuitem_7 = MenuItem()
treemenus_menuitem_7.parent = treemenus_menuitem_1
treemenus_menuitem_7.caption = u'Pacientes'
treemenus_menuitem_7.url = u''
treemenus_menuitem_7.named_url = u'persona-index'
treemenus_menuitem_7.level = 1
treemenus_menuitem_7.rank = 1
treemenus_menuitem_7.menu = treemenus_menu_1
treemenus_menuitem_7.save()
treemenus_menuitem_8 = MenuItem()
treemenus_menuitem_8.parent = treemenus_menuitem_1
treemenus_menuitem_8.caption = u'B\xfasqueda'
treemenus_menuitem_8.url = u''
treemenus_menuitem_8.named_url = u'haystack_search'
treemenus_menuitem_8.level = 1
treemenus_menuitem_8.rank = 5
treemenus_menuitem_8.menu = treemenus_menu_1
treemenus_menuitem_8.save()
treemenus_menuitem_9 = MenuItem()
treemenus_menuitem_9.parent = treemenus_menuitem_2
#.........这里部分代码省略.........