Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More
More about the application menu¶
In The mysite/settings.py file you shortly encountered the setup_menu
method to define your application
menu. There is more to say about it.
Introduction¶
The application menu is an important part of every Lino application. While the dashboard shows only the most frequently used data tables, the application menu gives (or should give) access to every part of your application.
- application menu¶
The application menu specifies how the different functionalities of an application are structured when presenting them to a site user as their main menu.
Every application has one and only one application menu. It’s the same structure for everybody, but users will see only the parts to which they have access permission. The menu shrinks or expands according to the user’s permissions.
The primitive application menu¶
For simple applications you can define the complete menu by overriding the
lino.core.site.Site.setup_menu()
method of your application.
An example for this approach is in The mysite/settings.py file. Let’s have a look at this application.
>>> import lino, os, sys
>>> os.chdir('lino_book/projects/polls')
>>> sys.path.append('.')
>>> lino.startup('mysite.settings')
>>> from lino.api.doctest import *
You have seen the application menu in a browser window. But you can also show it in a documentation page or an interactive Django shell:
>>> from lino.api.doctest import *
>>> show_menu('robin')
- Polls : Questions, Choices
- Site : About
In Playing with the Django shell we discovered the lino.api.doctest.show_menu()
function, which prints the application menu.