From a67715f53f316dfef0035abcb3e6caff595caaed Mon Sep 17 00:00:00 2001 From: James Murty Date: Tue, 29 Nov 2016 13:28:51 +1100 Subject: [PATCH] Add ICEkit Workflow features to events Apply the new `ICEkitContentsAdmin` & `ICEkitContentsAdmin` now available in ICEkit to add workflow features to events models & admins along with the existing publishing features. --- icekit_events/admin.py | 14 +++++++------- icekit_events/models.py | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/icekit_events/admin.py b/icekit_events/admin.py index 0f3616c..57d0019 100644 --- a/icekit_events/admin.py +++ b/icekit_events/admin.py @@ -34,7 +34,7 @@ from polymorphic.admin import PolymorphicChildModelAdmin from timezone import timezone as djtz # django-timezone -from icekit.publishing import admin as publishing_admin +from icekit import admin as icekit_admin from . import admin_forms, forms, models @@ -71,7 +71,7 @@ class OccurrencesInline(admin.TabularInline): class EventChildAdmin( PolymorphicChildModelAdmin, - publishing_admin.PublishingAdmin, + icekit_admin.ICEkitContentsAdmin, TitleSlugAdmin ): """ @@ -82,7 +82,7 @@ class EventChildAdmin( inlines = [ EventRepeatGeneratorsInline, OccurrencesInline, - ] + ] + icekit_admin.ICEkitContentsAdmin.inlines exclude = ( # Legacy fields, will be removed soon 'all_day', 'starts', 'ends', 'date_starts', 'date_ends', @@ -105,22 +105,22 @@ class EventTypeFilter(ChildModelFilter): class EventAdmin(ChildModelPluginPolymorphicParentModelAdmin, - publishing_admin.PublishingAdmin): + icekit_admin.ICEkitContentsAdmin): """ Polymorphic parent admin for Events. """ base_model = models.EventBase list_filter = ( EventTypeFilter, 'primary_type', 'secondary_types', 'modified', 'show_in_calendar', 'is_drop_in', 'has_tickets_available', - publishing_admin.PublishingStatusFilter, - publishing_admin.PublishingPublishedFilter, - ) + ) + icekit_admin.ICEkitContentsAdmin.list_filter list_display = ( '__str__', 'child_type_name', 'primary_type', 'modified', 'publishing_column', 'part_of_display', 'show_in_calendar', 'has_tickets_available', 'is_drop_in', 'occurrence_count', 'first_occurrence', 'last_occurrence', + # ICEkit Workflow columns + 'last_edited_by_column', 'workflow_states_column', ) search_fields = ('title', 'part_of__title', ) diff --git a/icekit_events/models.py b/icekit_events/models.py index d9c7836..61dc94d 100644 --- a/icekit_events/models.py +++ b/icekit_events/models.py @@ -25,9 +25,9 @@ from icekit.content_collections.abstract_models import AbstractListingPage, \ TitleSlugMixin +from icekit.models import ICEkitContentsMixin from icekit.fields import ICEkitURLField from icekit.mixins import FluentFieldsMixin -from icekit.publishing.models import PublishingModel, PublishableFluentContents from icekit.publishing.middleware import is_draft_request_context from django.template.defaultfilters import date as datefilter @@ -206,7 +206,7 @@ class EventType(TitleSlugMixin): ) @encoding.python_2_unicode_compatible -class EventBase(PolymorphicModel, AbstractBaseModel, PublishingModel, +class EventBase(PolymorphicModel, AbstractBaseModel, ICEkitContentsMixin, TitleSlugMixin): """ A polymorphic event model with all basic event features.