From a82f071ffb6ac327239729908448bab011a1dd7a Mon Sep 17 00:00:00 2001 From: James Murty Date: Thu, 24 Nov 2016 12:48:50 +1100 Subject: [PATCH] Register base event for ICEKitURLField Make ICEkit Event items available in the `ICEKitURLField` customisation of `AnyUrlField`. --- icekit_events/apps.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/icekit_events/apps.py b/icekit_events/apps.py index 3858f0c..e900bde 100644 --- a/icekit_events/apps.py +++ b/icekit_events/apps.py @@ -8,6 +8,10 @@ from django.apps import AppConfig from django.utils.module_loading import autodiscover_modules +from any_urlfield.forms import SimpleRawIdWidget + +from icekit.fields import ICEkitURLField + class AppConfig(AppConfig): name = '_'.join(__name__.split('.')[:-1]) @@ -17,3 +21,7 @@ class AppConfig(AppConfig): def ready(self): # look through installed apps to see what event types are registered autodiscover_modules('event_type_plugins') + + from .models import EventBase + ICEkitURLField.register_model( + EventBase, widget=SimpleRawIdWidget(EventBase), title='Event')