Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Add ICEkit Workflow features to events
Browse files Browse the repository at this point in the history
Apply the new `ICEkitContentsAdmin` & `ICEkitContentsAdmin` now
available in ICEkit to add workflow features to events models & admins
along with the existing publishing features.
  • Loading branch information
jmurty committed Nov 29, 2016
1 parent 9e29247 commit a67715f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions icekit_events/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -71,7 +71,7 @@ class OccurrencesInline(admin.TabularInline):

class EventChildAdmin(
PolymorphicChildModelAdmin,
publishing_admin.PublishingAdmin,
icekit_admin.ICEkitContentsAdmin,
TitleSlugAdmin
):
"""
Expand All @@ -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',
Expand All @@ -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', )

Expand Down
4 changes: 2 additions & 2 deletions icekit_events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a67715f

Please sign in to comment.