django-smartbase-admin 0.2.74__py3-none-any.whl → 0.2.75__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/field_formatter.py +11 -2
- django_smartbase_admin/services/views.py +1 -0
- {django_smartbase_admin-0.2.74.dist-info → django_smartbase_admin-0.2.75.dist-info}/METADATA +1 -1
- {django_smartbase_admin-0.2.74.dist-info → django_smartbase_admin-0.2.75.dist-info}/RECORD +6 -6
- {django_smartbase_admin-0.2.74.dist-info → django_smartbase_admin-0.2.75.dist-info}/LICENSE.md +0 -0
- {django_smartbase_admin-0.2.74.dist-info → django_smartbase_admin-0.2.75.dist-info}/WHEEL +0 -0
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
1
3
|
from django.template.defaultfilters import date, time
|
|
2
4
|
from django.utils.translation import gettext_lazy as _
|
|
3
5
|
from django.utils import timezone
|
|
4
6
|
|
|
5
7
|
|
|
8
|
+
class BadgeType(Enum):
|
|
9
|
+
SUCCESS = "positive"
|
|
10
|
+
NOTICE = "notice"
|
|
11
|
+
WARNING = "warning"
|
|
12
|
+
ERROR = "negative"
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
def datetime_formatter(object_id, value):
|
|
7
16
|
if value is None:
|
|
8
17
|
return None
|
|
@@ -33,14 +42,14 @@ def boolean_formatter(object_id, value):
|
|
|
33
42
|
return f'<span class="badge badge-simple badge-neutral">{_("No")}</span>'
|
|
34
43
|
|
|
35
44
|
|
|
36
|
-
def format_array(value_list, separator=""):
|
|
45
|
+
def format_array(value_list, separator="", badge_type: BadgeType = BadgeType.NOTICE):
|
|
37
46
|
result = ""
|
|
38
47
|
if not value_list:
|
|
39
48
|
return result
|
|
40
49
|
for value in value_list:
|
|
41
50
|
if not value:
|
|
42
51
|
continue
|
|
43
|
-
result += f'<span class="badge badge-simple badge-
|
|
52
|
+
result += f'<span class="badge badge-simple badge-{badge_type.value} mr-4">{value}</span>{separator}'
|
|
44
53
|
return result
|
|
45
54
|
|
|
46
55
|
|
|
@@ -34,6 +34,7 @@ class SBAdminViewService(object):
|
|
|
34
34
|
|
|
35
35
|
@classmethod
|
|
36
36
|
def process_url_params(cls, view_id, url_params, filter_version):
|
|
37
|
+
url_params = url_params or {}
|
|
37
38
|
filter_data = SBAdminViewService.process_filter_data_url(
|
|
38
39
|
view_id=view_id,
|
|
39
40
|
filter_data=url_params.get(FILTER_DATA_NAME, {}),
|
|
@@ -18,7 +18,7 @@ django_smartbase_admin/engine/const.py,sha256=vU_XMy76BYiw1tu88lw8UDGk-cW5oo62gh
|
|
|
18
18
|
django_smartbase_admin/engine/dashboard.py,sha256=wrvX0GI-SII2pG0DX8Kvy4JFaM6h8e6R7KSCFddFC64,23642
|
|
19
19
|
django_smartbase_admin/engine/fake_inline.py,sha256=9C2_mltg2P9-xa3vuoo5X_RcFaCRpKGNSy7t1_iiasE,5802
|
|
20
20
|
django_smartbase_admin/engine/field.py,sha256=BD_W0ekE5tQJxUGpUA8bo4ZyFk0u2F_6UTPH4drj0JU,10286
|
|
21
|
-
django_smartbase_admin/engine/field_formatter.py,sha256=
|
|
21
|
+
django_smartbase_admin/engine/field_formatter.py,sha256=eHbXEBwG8jBc9zKpDQ4T64N5J4afF0Cbb8RFeFfgQRg,1950
|
|
22
22
|
django_smartbase_admin/engine/filter_widgets.py,sha256=lHPMilA2tjtwnwqPw2nUE39BL1Dx_v4HNKhmg6szHUY,23687
|
|
23
23
|
django_smartbase_admin/engine/global_filter_form.py,sha256=jlj6e9VYWDPyUNjcgj3gTIkCZXO01NZOWAeU3jFtkoA,249
|
|
24
24
|
django_smartbase_admin/engine/menu_item.py,sha256=rMJFG5xm1T0wF8lUmiAZHzKtt9C0LdbpRFvaP0PlngM,2936
|
|
@@ -42,7 +42,7 @@ django_smartbase_admin/services/configuration.py,sha256=POMI0htBqFS9ptPXMtOhIlIK
|
|
|
42
42
|
django_smartbase_admin/services/data.py,sha256=o36B_H9RnBvaQz3Rs3NygY1hVTr6hc89M-RK1saRXzc,156
|
|
43
43
|
django_smartbase_admin/services/thread_local.py,sha256=C3x7hPsKRCddr05RGiN0f6fcSQ8qsrYRdx9oeMHRovU,293
|
|
44
44
|
django_smartbase_admin/services/translations.py,sha256=aiekREx8KQA9CQRmtkUcys4ICJERMrkxPnLysp0YXO8,5606
|
|
45
|
-
django_smartbase_admin/services/views.py,sha256=
|
|
45
|
+
django_smartbase_admin/services/views.py,sha256=Drg5Y_sYyzVGEDjpT0e5bZAbylD_GdQMXKApxEr31cg,8991
|
|
46
46
|
django_smartbase_admin/services/xlsx_export.py,sha256=fnIqahmZR6G5T5wSH-sXhhLSy1QD3A-OY6BAn1WLLOc,10723
|
|
47
47
|
django_smartbase_admin/static/sb_admin/build/postcss.config.js,sha256=JlIB66vejH4YA3sPp7hDjimQXAGz5WlVhFDwjBDNTEo,610
|
|
48
48
|
django_smartbase_admin/static/sb_admin/build/tailwind.config.js,sha256=5q5CGlXyn5s3hB6k2OCTu4auVcY4_yop5TrM5g0pT80,2369
|
|
@@ -658,7 +658,7 @@ django_smartbase_admin/views/dashboard_view.py,sha256=vtz5emYTQ5WDFeLA8HrcmjSOVd
|
|
|
658
658
|
django_smartbase_admin/views/global_filter_view.py,sha256=eYo1moJGyi7jc2cPDA5ZBiEgA7Hmc-DxbQvbqUpDkg8,1127
|
|
659
659
|
django_smartbase_admin/views/media_view.py,sha256=5BLWXuzynF7nM34t-mf2BQSRN5ojY8HxpLIqt7Jiq9g,292
|
|
660
660
|
django_smartbase_admin/views/translations_view.py,sha256=A02q1t13akLKd2Pg_ej4tVi5qPUKYxB2LqsBbYXM0l8,20267
|
|
661
|
-
django_smartbase_admin-0.2.
|
|
662
|
-
django_smartbase_admin-0.2.
|
|
663
|
-
django_smartbase_admin-0.2.
|
|
664
|
-
django_smartbase_admin-0.2.
|
|
661
|
+
django_smartbase_admin-0.2.75.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
|
|
662
|
+
django_smartbase_admin-0.2.75.dist-info/METADATA,sha256=3LhBbwW73p19qKtw2aJIJsXXsopbCj00ofFL3RF8R0U,945
|
|
663
|
+
django_smartbase_admin-0.2.75.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
664
|
+
django_smartbase_admin-0.2.75.dist-info/RECORD,,
|
{django_smartbase_admin-0.2.74.dist-info → django_smartbase_admin-0.2.75.dist-info}/LICENSE.md
RENAMED
|
File without changes
|
|
File without changes
|