Skip to content

Commit d2dbdd6

Browse files
author
Mishbah
committed
Update usage doc
1 parent e85dd08 commit d2dbdd6

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

docs/usage.rst

+40-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,44 @@
22
Usage
33
========
44

5-
To use django-modeladmin-reorder in a project::
5+
1. Add `admin_reorder` to `INSTALLED_APPS`::
66

7-
import django-modeladmin-reorder
7+
INSTALLED_APPS = (
8+
...
9+
'admin_reorder',
10+
...
11+
)
12+
13+
14+
2. Add the `ModelAdminReorder` to `MIDDLEWARE_CLASSES`::
15+
16+
17+
MIDDLEWARE_CLASSES = (
18+
...
19+
'admin_reorder.middleware.ModelAdminReorder',
20+
...
21+
)
22+
23+
24+
3. Add the setting `ADMIN_REORDER` to your settings.py::
25+
26+
27+
ADMIN_REORDER = (
28+
# Keep original label and models
29+
'sites',
30+
31+
# Rename app
32+
{'app': 'auth', 'label': 'Authorisation'},
33+
34+
# Reorder app models
35+
{'app': 'auth', 'models': ('auth.User', 'auth.Group')},
36+
37+
# Cross-linked models
38+
{'app': 'auth', 'models': ('auth.User', 'sites.Site')},
39+
40+
# models with custom name
41+
{'app': 'auth', 'models': (
42+
'auth.User',
43+
{'model': 'auth.Group', 'label': 'User Group'},
44+
)},
45+
)

0 commit comments

Comments
 (0)