django_fhadmin 2.2.0__tar.gz → 2.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/PKG-INFO +22 -3
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/README.rst +21 -2
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/django_fhadmin.egg-info/PKG-INFO +22 -3
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/fhadmin/__init__.py +1 -1
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/fhadmin/templates/admin/group_list.html +2 -3
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/fhadmin/templates/admin/index.html +1 -1
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/fhadmin/templatetags/fhadmin_module_groups.py +21 -6
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/LICENSE +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/MANIFEST.in +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/django_fhadmin.egg-info/SOURCES.txt +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/django_fhadmin.egg-info/dependency_links.txt +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/django_fhadmin.egg-info/requires.txt +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/django_fhadmin.egg-info/top_level.txt +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/fhadmin/locale/de/LC_MESSAGES/django.mo +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/fhadmin/locale/de/LC_MESSAGES/django.po +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/fhadmin/models.py +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/fhadmin/static/fhadmin/fhadmin.css +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/fhadmin/static/fhadmin/fhadmin.js +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/fhadmin/templates/admin/base_site.html +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/fhadmin/templatetags/__init__.py +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/setup.cfg +0 -0
- {django_fhadmin-2.2.0 → django_fhadmin-2.2.2}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: django_fhadmin
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: Modifies the stock Django-Administration interface to fit our ideas a little bit better.
|
|
5
5
|
Home-page: http://github.com/feinheit/django-fhadmin/
|
|
6
6
|
Author: Matthias Kestenholz
|
|
@@ -28,9 +28,12 @@ Dashboard and global navigation extension
|
|
|
28
28
|
-----------------------------------------
|
|
29
29
|
|
|
30
30
|
Allows grouping of apps on the dashboard and offers the same view on each
|
|
31
|
-
admin page
|
|
31
|
+
admin page when clicking the main title of the Django admin interface.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
App label entries without a matching app are ignored. A configuration example
|
|
34
|
+
follows:
|
|
35
|
+
|
|
36
|
+
.. code-block:: python
|
|
34
37
|
|
|
35
38
|
from fhadmin import FHADMIN_GROUPS_REMAINING
|
|
36
39
|
_ = lambda x: x
|
|
@@ -46,3 +49,19 @@ The extension is activated by inserting ``fhadmin`` before
|
|
|
46
49
|
``django.contrib.admin`` in ``INSTALLED_APPS``.
|
|
47
50
|
|
|
48
51
|
|
|
52
|
+
Merging apps
|
|
53
|
+
------------
|
|
54
|
+
|
|
55
|
+
Merging apps is possible as follows:
|
|
56
|
+
|
|
57
|
+
.. code-block:: python
|
|
58
|
+
|
|
59
|
+
FHADMIN_MERGE = {"accounts": "auth"}
|
|
60
|
+
|
|
61
|
+
This example moves all models from the ``accounts`` app to the ``auth``
|
|
62
|
+
heading. Both app labels have to exist. Note that this only changes the start
|
|
63
|
+
page of the Django admin panel and of course the global navigation. Note that
|
|
64
|
+
strange things (or worse) may happen if the user has access to only one or the
|
|
65
|
+
other app.
|
|
66
|
+
|
|
67
|
+
|
|
@@ -9,9 +9,12 @@ Dashboard and global navigation extension
|
|
|
9
9
|
-----------------------------------------
|
|
10
10
|
|
|
11
11
|
Allows grouping of apps on the dashboard and offers the same view on each
|
|
12
|
-
admin page
|
|
12
|
+
admin page when clicking the main title of the Django admin interface.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
App label entries without a matching app are ignored. A configuration example
|
|
15
|
+
follows:
|
|
16
|
+
|
|
17
|
+
.. code-block:: python
|
|
15
18
|
|
|
16
19
|
from fhadmin import FHADMIN_GROUPS_REMAINING
|
|
17
20
|
_ = lambda x: x
|
|
@@ -25,3 +28,19 @@ Configuration example::
|
|
|
25
28
|
|
|
26
29
|
The extension is activated by inserting ``fhadmin`` before
|
|
27
30
|
``django.contrib.admin`` in ``INSTALLED_APPS``.
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Merging apps
|
|
34
|
+
------------
|
|
35
|
+
|
|
36
|
+
Merging apps is possible as follows:
|
|
37
|
+
|
|
38
|
+
.. code-block:: python
|
|
39
|
+
|
|
40
|
+
FHADMIN_MERGE = {"accounts": "auth"}
|
|
41
|
+
|
|
42
|
+
This example moves all models from the ``accounts`` app to the ``auth``
|
|
43
|
+
heading. Both app labels have to exist. Note that this only changes the start
|
|
44
|
+
page of the Django admin panel and of course the global navigation. Note that
|
|
45
|
+
strange things (or worse) may happen if the user has access to only one or the
|
|
46
|
+
other app.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: django-fhadmin
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: Modifies the stock Django-Administration interface to fit our ideas a little bit better.
|
|
5
5
|
Home-page: http://github.com/feinheit/django-fhadmin/
|
|
6
6
|
Author: Matthias Kestenholz
|
|
@@ -28,9 +28,12 @@ Dashboard and global navigation extension
|
|
|
28
28
|
-----------------------------------------
|
|
29
29
|
|
|
30
30
|
Allows grouping of apps on the dashboard and offers the same view on each
|
|
31
|
-
admin page
|
|
31
|
+
admin page when clicking the main title of the Django admin interface.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
App label entries without a matching app are ignored. A configuration example
|
|
34
|
+
follows:
|
|
35
|
+
|
|
36
|
+
.. code-block:: python
|
|
34
37
|
|
|
35
38
|
from fhadmin import FHADMIN_GROUPS_REMAINING
|
|
36
39
|
_ = lambda x: x
|
|
@@ -46,3 +49,19 @@ The extension is activated by inserting ``fhadmin`` before
|
|
|
46
49
|
``django.contrib.admin`` in ``INSTALLED_APPS``.
|
|
47
50
|
|
|
48
51
|
|
|
52
|
+
Merging apps
|
|
53
|
+
------------
|
|
54
|
+
|
|
55
|
+
Merging apps is possible as follows:
|
|
56
|
+
|
|
57
|
+
.. code-block:: python
|
|
58
|
+
|
|
59
|
+
FHADMIN_MERGE = {"accounts": "auth"}
|
|
60
|
+
|
|
61
|
+
This example moves all models from the ``accounts`` app to the ``auth``
|
|
62
|
+
heading. Both app labels have to exist. Note that this only changes the start
|
|
63
|
+
page of the Django admin panel and of course the global navigation. Note that
|
|
64
|
+
strange things (or worse) may happen if the user has access to only one or the
|
|
65
|
+
other app.
|
|
66
|
+
|
|
67
|
+
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{% load fhadmin_module_groups i18n %}
|
|
2
|
-
{% fhadmin_group_list request %}
|
|
3
|
-
|
|
2
|
+
{% fhadmin_group_list request as group_list %}
|
|
4
3
|
{% if group_list %}
|
|
5
4
|
<div class="groups">
|
|
6
5
|
{% for group, app_list in group_list %}
|
|
7
6
|
<div class="group">
|
|
8
7
|
<h2>{{ group }}</h2>
|
|
9
|
-
{% include 'admin/app_list.html' %}
|
|
8
|
+
{% include 'admin/app_list.html' with show_changelinks=False %}
|
|
10
9
|
</div>
|
|
11
10
|
{% endfor %}
|
|
12
11
|
</div>
|
|
@@ -40,9 +40,20 @@ FHADMIN_GROUPS_DEFAULT = [
|
|
|
40
40
|
]
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
def generate_group_list(admin_site, request):
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
def generate_group_list(admin_site, request, *, only_app_label=None):
|
|
44
|
+
app_dict = {a["app_label"]: a for a in admin_site.get_app_list(request)}
|
|
45
|
+
|
|
46
|
+
if merge := getattr(settings, "FHADMIN_MERGE", {}):
|
|
47
|
+
for app_label, merge_into in merge.items():
|
|
48
|
+
app_dict[merge_into]["models"] = sorted(
|
|
49
|
+
app_dict[merge_into]["models"] + app_dict.pop(app_label)["models"],
|
|
50
|
+
key=lambda row: row["name"],
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
if only_app_label is not None:
|
|
54
|
+
for key in list(app_dict):
|
|
55
|
+
if key != only_app_label:
|
|
56
|
+
app_dict.pop(key)
|
|
46
57
|
|
|
47
58
|
fhadmin_groups = getattr(settings, "FHADMIN_GROUPS", FHADMIN_GROUPS_DEFAULT)
|
|
48
59
|
all_configured = reduce(
|
|
@@ -54,7 +65,7 @@ def generate_group_list(admin_site, request):
|
|
|
54
65
|
for app in apps:
|
|
55
66
|
if app == FHADMIN_GROUPS_REMAINING:
|
|
56
67
|
group_apps.extend(
|
|
57
|
-
a for a in
|
|
68
|
+
a for a in app_dict.values() if a["app_label"] not in all_configured
|
|
58
69
|
)
|
|
59
70
|
elif app in app_dict:
|
|
60
71
|
group_apps.append(app_dict[app])
|
|
@@ -65,5 +76,9 @@ def generate_group_list(admin_site, request):
|
|
|
65
76
|
|
|
66
77
|
@register.simple_tag(takes_context=True)
|
|
67
78
|
def fhadmin_group_list(context, request):
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
only_app_label = None
|
|
80
|
+
if context.get("apply_app_label_filtering"):
|
|
81
|
+
only_app_label = context.get("app_label")
|
|
82
|
+
return list(
|
|
83
|
+
generate_group_list(admin.sites.site, request, only_app_label=only_app_label)
|
|
84
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|