8000 Update documentation · socketpy/django-jet@ea37557 · GitHub
[go: up one dir, main page]

Skip to content

Commit ea37557

Browse files
committed
Update documentation
1 parent 6875fd4 commit ea37557

File tree

1 file changed

+54
-28
lines changed

1 file changed

+54
-28
lines changed

docs/config_file.rst

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -95,61 +95,87 @@ CUSTOM MENU
9595
-----------
9696

9797
By default JET displays all applications and it models in the side menu in the alphabetical order.
98-
To display applications and models you want or to change their order you can use ``JET_SIDE_MENU_CUSTOM_APPS`` setting.
98+
To display applications and models you want or to change their order you can use ``JET_SIDE_MENU_ITEMS`` setting.
9999

100100
.. code:: python
101101
102-
JET_SIDE_MENU_CUSTOM_APPS = [
103-
('core', [ # Each list element is a tuple with application name (app_label) and list of models
104-
'User',
105-
'MenuItem',
106-
'Block',
107-
]),
108-
('shops', [
109-
'Shop',
110-
'City',
111-
'MetroStation',
112-
]),
113-
('feedback', [
114-
'Feedback',
115-
]),
102+
JET_SIDE_MENU_ITEMS = [ # A list of application or custom dicts
103+
{'label': _('General'), 'app_label': 'core', 'models': [
104+
{'name': 'help.question'},
105+
{'name': 'pages.page'},
106+
{'name': 'city'},
107+
{'name': 'validationcode'},
108+
]},
109+
{'label': _('Users'), 'models': [
110+
{'name': 'core.user'},
111+
{'name': 'auth.group'},
112+
{'name': 'core.userprofile'},
113+
]},
114+
{'app_label': 'banners', 'models': [
115+
{'name': 'banner'},
116+
{'name': 'bannertype'},
117+
]},
118+
{'app_label': 'talks', 'models': [
119+
{'name': 'talk'},
120+
{'name': 'talkmessage'},
121+
]},
116122
]
117123
118-
If want to show all application's models use ``__all__`` keyword.
124+
.. deprecated:: 1.0.6
119125

120-
.. code:: python
126+
Old way of customizing menu items via `JET_SIDE_MENU_CUSTOM_APPS` setting is now deprecated in favor
127+
of new `JET_SIDE_MENU_ITEMS` setting.
121128

122-
JET_SIDE_MENU_CUSTOM_APPS = [
123-
('core', ['__all__']),
124-
...
125-
]
129+
.. code:: python
130+
131+
JET_SIDE_MENU_CUSTOM_APPS = [
132+
('core', [ # Each list element is a tuple with application name (app_label) and list of models
133+
'User',
134+
'MenuItem',
135+
'Block',
136+
]),
137+
('shops', [
138+
'Shop',
139+
'City',
140+
'MetroStation',
141+
]),
142+
('feedback', [
143+
'Feedback',
144+
]),
145+
]
126146
127147
If have multiple admin sites and you want to specify different menu applications for each admin site, wrap menu lists
128148
in dictionary with admin site names as keys:
129149

130150
.. code:: python
131151
132-
JET_SIDE_MENU_CUSTOM_APPS = {
152+
JET_SIDE_MENU_ITEMS = {
133153
'admin': [
134-
('core', ['__all__']),
154+
{'label': _('General'), 'app_label': 'core', 'models': [
155+
{'name': 'help.question'},
156+
{'name': 'pages.page'},
157+
{'name': 'city'},
158+
{'name': 'validationcode'},
159+
]},
135160
...
136161
],
137162
'custom_admin': [
138-
('custom_admin_app', [
139-
'CustomAdminAppModel',
140-
]),
163+
{'app_label': 'talks', 'models': [
164+
{'name': 'talk'},
165+
{'name': 'talkmessage'},
166+
]},
141167
...
142168
]
143169
}
144170
145171
.. note::
146172

147-
You can use ``jet_custom_apps_example`` management command to generate example ``JET_SIDE_MENU_CUSTOM_APPS``
173+
You can use ``jet_side_menu_items_example`` management command to generate example ``JET_SIDE_MENU_ITEMS``
148174
setting which includes all your applications and models. You can use it this way:
149175

150176
.. code:: python
151177
152-
python manage.py jet_custom_apps_example
178+
python manage.py jet_side_menu_items_example
153179
154180
JET_CHANGE_FORM_SIBLING_LINKS
155181
-----------------------------

0 commit comments

Comments
 (0)
0