diff --git a/blitz_api/settings.py b/blitz_api/settings.py index 3c09de4e..4f61eea0 100644 --- a/blitz_api/settings.py +++ b/blitz_api/settings.py @@ -59,7 +59,8 @@ 'safedelete', 'import_export', 'django_filters', - 'admin_auto_filters' + 'admin_auto_filters', + 'django_admin_inline_paginator', ] MIDDLEWARE = [ diff --git a/cron_manager/admin.py b/cron_manager/admin.py index 825fafa5..d081ca72 100644 --- a/cron_manager/admin.py +++ b/cron_manager/admin.py @@ -3,6 +3,7 @@ from . import models from django.utils.translation import ugettext_lazy as _ +from django_admin_inline_paginator.admin import TabularInlinePaginated class TaskFilter(AutocompleteFilter): @@ -10,7 +11,7 @@ class TaskFilter(AutocompleteFilter): field_name = 'task' -class ExecutionInline(admin.StackedInline): +class ExecutionInline(TabularInlinePaginated): model = models.Execution can_delete = True show_change_link = True @@ -18,6 +19,7 @@ class ExecutionInline(admin.StackedInline): fk_name = 'task' readonly_fields = ('created_at',) max_num = 10 + per_page = 5 class TaskAdmin(admin.ModelAdmin): diff --git a/requirements.txt b/requirements.txt index 6501116b..d51c8525 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,4 +28,6 @@ tqdm==4.54.1 colorama==0.4.4 django-admin-autocomplete-filter==0.6.1 mailchimp3==3.0.14 -babel==2.9.0 \ No newline at end of file +babel==2.9.0 + +django-admin-inline-paginator==0.1.1 \ No newline at end of file diff --git a/store/resources.py b/store/resources.py index ed16dceb..6b719283 100644 --- a/store/resources.py +++ b/store/resources.py @@ -116,6 +116,9 @@ class Meta: 'item_id', 'quantity', 'order', + 'coupon', + 'coupon_real_value', + 'cost', ) export_order = ( 'id', @@ -125,6 +128,9 @@ class Meta: 'item_id', 'quantity', 'order', + 'coupon', + 'coupon_real_value', + 'cost', ) diff --git a/store/tests/tests_viewset_Order.py b/store/tests/tests_viewset_Order.py index 5fabe44f..65aabb39 100644 --- a/store/tests/tests_viewset_Order.py +++ b/store/tests/tests_viewset_Order.py @@ -3374,13 +3374,6 @@ def test_validate_coupon(self): ) content = { - 'orderline': { - 'content_type': 'package', - 'object_id': self.package.id, - 'quantity': 2, - 'metadata': None, - 'options': [] - }, 'value': 10.0 }