django-smartbase-admin 0.2.88__py3-none-any.whl → 0.2.89__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/admin/admin_base.py +0 -1
- django_smartbase_admin/engine/admin_base_view.py +1 -0
- django_smartbase_admin/engine/filter_widgets.py +18 -13
- django_smartbase_admin/static/sb_admin/dist/chart.js +1 -1
- django_smartbase_admin/static/sb_admin/dist/main.js +1 -1
- django_smartbase_admin/static/sb_admin/dist/main_style.css +1 -1
- django_smartbase_admin/static/sb_admin/dist/table.js +1 -1
- django_smartbase_admin/static/sb_admin/src/css/_datepicker.css +3 -0
- django_smartbase_admin/static/sb_admin/src/css/components/_query-builder.css +2 -1
- django_smartbase_admin/static/sb_admin/src/js/datepicker.js +71 -9
- django_smartbase_admin/static/sb_admin/src/js/datepicker_plugins.js +72 -46
- django_smartbase_admin/static/sb_admin/src/js/table_modules/advanced_filter_module.js +16 -9
- django_smartbase_admin/static/sb_admin/src/js/utils.js +5 -0
- django_smartbase_admin/templates/sb_admin/filter_widgets/advanced_filters/date_field.html +9 -2
- django_smartbase_admin/templates/sb_admin/filter_widgets/date_field.html +15 -5
- django_smartbase_admin/templates/sb_admin/includes/inline_fieldset.html +1 -1
- {django_smartbase_admin-0.2.88.dist-info → django_smartbase_admin-0.2.89.dist-info}/METADATA +1 -1
- {django_smartbase_admin-0.2.88.dist-info → django_smartbase_admin-0.2.89.dist-info}/RECORD +20 -20
- {django_smartbase_admin-0.2.88.dist-info → django_smartbase_admin-0.2.89.dist-info}/LICENSE.md +0 -0
- {django_smartbase_admin-0.2.88.dist-info → django_smartbase_admin-0.2.89.dist-info}/WHEEL +0 -0
|
@@ -652,7 +652,6 @@ class SBAdmin(
|
|
|
652
652
|
):
|
|
653
653
|
change_list_template = "sb_admin/actions/list.html"
|
|
654
654
|
change_form_template = "sb_admin/actions/change_form.html"
|
|
655
|
-
delete_confirmation_template = "sb_admin/actions/delete_confirmation.html"
|
|
656
655
|
delete_selected_confirmation_template = (
|
|
657
656
|
"sb_admin/actions/delete_selected_confirmation.html"
|
|
658
657
|
)
|
|
@@ -49,6 +49,7 @@ class SBAdminBaseView(object):
|
|
|
49
49
|
global_filter_data_map = None
|
|
50
50
|
field_cache = None
|
|
51
51
|
sbadmin_detail_actions = None
|
|
52
|
+
delete_confirmation_template = "sb_admin/actions/delete_confirmation.html"
|
|
52
53
|
|
|
53
54
|
def init_view_static(self, configuration, model, admin_site):
|
|
54
55
|
pass
|
|
@@ -308,13 +308,7 @@ class DateFilterWidget(SBAdminFilterWidget):
|
|
|
308
308
|
return DATE_ATTRIBUTES
|
|
309
309
|
|
|
310
310
|
def process_shortcut(self, shortcut, now):
|
|
311
|
-
return
|
|
312
|
-
"label": shortcut["label"],
|
|
313
|
-
"value": [
|
|
314
|
-
now + timedelta(days=shortcut["value"][0]),
|
|
315
|
-
now + timedelta(days=shortcut["value"][1]),
|
|
316
|
-
],
|
|
317
|
-
}
|
|
311
|
+
return shortcut
|
|
318
312
|
|
|
319
313
|
def get_shortcuts(self):
|
|
320
314
|
now = timezone.now()
|
|
@@ -379,12 +373,23 @@ class DateFilterWidget(SBAdminFilterWidget):
|
|
|
379
373
|
if filter_value is None:
|
|
380
374
|
return [None, None]
|
|
381
375
|
date_format = cls.DATE_FORMAT
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
376
|
+
if type(filter_value) is list:
|
|
377
|
+
return [
|
|
378
|
+
timezone.now() + timedelta(days=filter_value[0]),
|
|
379
|
+
timezone.now() + timedelta(days=filter_value[1]),
|
|
380
|
+
]
|
|
381
|
+
try:
|
|
382
|
+
days_range = json.loads(filter_value)
|
|
383
|
+
return [
|
|
384
|
+
timezone.now() + timedelta(days=days_range[0]),
|
|
385
|
+
timezone.now() + timedelta(days=days_range[1]),
|
|
386
|
+
]
|
|
387
|
+
except json.decoder.JSONDecodeError:
|
|
388
|
+
date_range = filter_value.split(cls.DATE_RANGE_SPLIT)
|
|
389
|
+
if len(date_range) == 2:
|
|
390
|
+
date_from = datetime.strptime(date_range[0], date_format)
|
|
391
|
+
date_to = datetime.strptime(date_range[1], date_format)
|
|
392
|
+
return [date_from, date_to]
|
|
388
393
|
date_value = datetime.strptime(filter_value, date_format)
|
|
389
394
|
return [date_value, date_value]
|
|
390
395
|
|