django-smartbase-admin 1.0.4b1__py3-none-any.whl → 1.0.5__py3-none-any.whl
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_smartbase_admin/engine/actions.py +8 -0
- django_smartbase_admin/engine/fake_inline.py +0 -3
- django_smartbase_admin/monkeypatch/fake_inline_monkeypatch.py +1 -1
- django_smartbase_admin/static/sb_admin/dist/main_style.css +1 -1
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Bolt-one.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Electric-drill.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Fire-extinguisher.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Gas.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Lightning-fill.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Printer.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Pull.svg +3 -0
- django_smartbase_admin/templates/sb_admin/actions/list.html +40 -14
- django_smartbase_admin/templates/sb_admin/actions/partials/action_link.html +14 -0
- django_smartbase_admin/templates/sb_admin/sprites/sb_admin.svg +1 -1
- django_smartbase_admin/views/translations_view.py +4 -3
- {django_smartbase_admin-1.0.4b1.dist-info → django_smartbase_admin-1.0.5.dist-info}/METADATA +12 -3
- {django_smartbase_admin-1.0.4b1.dist-info → django_smartbase_admin-1.0.5.dist-info}/RECORD +19 -11
- {django_smartbase_admin-1.0.4b1.dist-info → django_smartbase_admin-1.0.5.dist-info}/LICENSE.md +0 -0
- {django_smartbase_admin-1.0.4b1.dist-info → django_smartbase_admin-1.0.5.dist-info}/WHEEL +0 -0
|
@@ -22,6 +22,8 @@ class SBAdminCustomAction(object):
|
|
|
22
22
|
no_params=False,
|
|
23
23
|
open_in_modal=False,
|
|
24
24
|
group=None,
|
|
25
|
+
sub_actions=None,
|
|
26
|
+
icon=None,
|
|
25
27
|
) -> None:
|
|
26
28
|
super().__init__()
|
|
27
29
|
self.title = title
|
|
@@ -33,9 +35,15 @@ class SBAdminCustomAction(object):
|
|
|
33
35
|
self.no_params = no_params
|
|
34
36
|
self.open_in_modal = open_in_modal
|
|
35
37
|
self.group = group
|
|
38
|
+
self.sub_actions = sub_actions
|
|
39
|
+
self.icon = icon
|
|
36
40
|
self.resolve_url()
|
|
37
41
|
|
|
38
42
|
def resolve_url(self):
|
|
43
|
+
if self.sub_actions:
|
|
44
|
+
for sub_action in self.sub_actions:
|
|
45
|
+
sub_action.resolve_url()
|
|
46
|
+
return
|
|
39
47
|
if not (self.url or (self.view and self.action_id)):
|
|
40
48
|
raise ImproperlyConfigured(
|
|
41
49
|
"You must provide either url or view and action_id"
|
|
@@ -77,9 +77,6 @@ class SBAdminFakeInlineMixin:
|
|
|
77
77
|
|
|
78
78
|
def get_formset(self, request, obj=None, **kwargs):
|
|
79
79
|
formset = super().get_formset(request, obj, **kwargs)
|
|
80
|
-
fake_fk = models.ForeignKey(self.original_model, on_delete=models.SET_NULL)
|
|
81
|
-
fake_fk.set_attributes_from_name("inline_fake_relationship")
|
|
82
|
-
formset.fk = fake_fk
|
|
83
80
|
formset.queryset = self.get_queryset(request)
|
|
84
81
|
formset.original_model = self.original_model
|
|
85
82
|
formset.inline_instance = self
|
|
@@ -14,7 +14,7 @@ def monkeypatch_get_foreign_key(fnc):
|
|
|
14
14
|
result = models.ForeignKey(
|
|
15
15
|
model.original_model, on_delete=models.DO_NOTHING
|
|
16
16
|
)
|
|
17
|
-
result.
|
|
17
|
+
result.set_attributes_from_name(SBAdminFakeInlineMixin.fk_name)
|
|
18
18
|
|
|
19
19
|
return result
|
|
20
20
|
|