diff --git a/icekit_events/page_types/advancedeventlisting/migrations/0001_initial.py b/icekit_events/page_types/advancedeventlisting/migrations/0001_initial.py index 7d223ed7..e8d1815b 100644 --- a/icekit_events/page_types/advancedeventlisting/migrations/0001_initial.py +++ b/icekit_events/page_types/advancedeventlisting/migrations/0001_initial.py @@ -2,17 +2,17 @@ from __future__ import unicode_literals from django.db import migrations, models -import django.db.models.deletion import django.utils.timezone +import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('icekit_plugins_image', '0022_auto_20170622_1024'), - ('icekit_events', '0029_fix_malformed_rrules_20170830_1101'), + ('icekit_events', '0030_auto_20171002_1551'), ('fluent_pages', '0001_initial'), - ('icekit_plugins_location', '0005_auto_20170905_1136'), + ('icekit_plugins_location', '0007_auto_20171005_1708'), ('icekit', '0007_auto_20170310_1220'), ] @@ -20,7 +20,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='AdvancedEventListingPage', fields=[ - ('urlnode_ptr', models.OneToOneField(auto_created=True, serialize=False, primary_key=True, parent_link=True, to='fluent_pages.UrlNode')), + ('urlnode_ptr', models.OneToOneField(primary_key=True, to='fluent_pages.UrlNode', serialize=False, auto_created=True, parent_link=True)), ('brief', models.TextField(help_text=b'A document brief describing the purpose of this content', blank=True)), ('admin_notes', models.TextField(help_text=b"Administrator's notes about this content", blank=True)), ('list_image', models.ImageField(upload_to=b'icekit/listable/list_image/', help_text=b"image to use in listings. Default image is used if this isn't given", blank=True)), @@ -31,12 +31,12 @@ class Migration(migrations.Migration): ('limit_to_home_locations', models.BooleanField(default=False)), ('default_start_date', models.DateField(blank=True, help_text=b"Default start date for event occurrences when the user has not selected a value. Leave empty to use today's date", null=True)), ('default_days_to_show', models.IntegerField(blank=True, help_text=b'Default period in days after the start date to show event occurrences when the user has not selected a value. Leave empty to use the value from Events setting `appsettings.DEFAULT_DAYS_TO_SHOW`', null=True)), - ('hero_image', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to='icekit_plugins_image.Image', blank=True, related_name='+', help_text=b'The hero image for this content.')), - ('layout', models.ForeignKey(null=True, to='icekit.Layout', blank=True, related_name='advancedeventlisting_advancedeventlistingpage_related')), - ('limit_to_locations', models.ManyToManyField(db_table=b'advanced_event_listing_page_locations', help_text=b'Leave empty to show all events.', to='icekit_plugins_location.Location', blank=True)), - ('limit_to_primary_types', models.ManyToManyField(related_name='_advancedeventlistingpage_limit_to_primary_types_+', db_table=b'advanced_event_listing_page_primary_types', help_text=b'Leave empty to show all events.', to='icekit_events.EventType', blank=True)), - ('limit_to_secondary_types', models.ManyToManyField(related_name='_advancedeventlistingpage_limit_to_secondary_types_+', db_table=b'advanced_event_listing_page_secondary_types', help_text=b'Leave empty to show all events.', to='icekit_events.EventType', blank=True)), - ('publishing_linked', models.OneToOneField(on_delete=django.db.models.deletion.SET_NULL, null=True, to='advancedeventlisting.AdvancedEventListingPage', related_name='publishing_draft', editable=False)), + ('hero_image', models.ForeignKey(related_name='+', to='icekit_plugins_image.Image', null=True, on_delete=django.db.models.deletion.SET_NULL, blank=True, help_text=b'The hero image for this content.')), + ('layout', models.ForeignKey(related_name='advancedeventlisting_advancedeventlistingpage_related', to='icekit.Layout', null=True, blank=True)), + ('limit_to_locations', models.ManyToManyField(help_text=b'Leave empty to show all events.', to='icekit_plugins_location.Location', blank=True)), + ('limit_to_primary_types', models.ManyToManyField(related_name='_advancedeventlistingpage_limit_to_primary_types_+', help_text=b'Leave empty to show all events.', to='icekit_events.EventType', blank=True)), + ('limit_to_secondary_types', models.ManyToManyField(related_name='_advancedeventlistingpage_limit_to_secondary_types_+', help_text=b'Leave empty to show all events.', to='icekit_events.EventType', blank=True)), + ('publishing_linked', models.OneToOneField(related_name='publishing_draft', to='advancedeventlisting.AdvancedEventListingPage', editable=False, on_delete=django.db.models.deletion.SET_NULL, null=True)), ], options={ 'verbose_name': 'Advanced Event listing', diff --git a/icekit_events/page_types/advancedeventlisting/models.py b/icekit_events/page_types/advancedeventlisting/models.py index e6f7f2eb..534b9755 100644 --- a/icekit_events/page_types/advancedeventlisting/models.py +++ b/icekit_events/page_types/advancedeventlisting/models.py @@ -17,7 +17,7 @@ class AbstractAdvancedEventListingPage(AbstractListingPage): help_text="Leave empty to show all events.", blank=True, # Explicit `db_table` required to avoid errors creating FK constraints - db_table="advanced_event_listing_page_primary_types", + #db_table="advanced_event_listing_page_primary_types", related_name="+", ) limit_to_secondary_types = models.ManyToManyField( @@ -25,7 +25,7 @@ class AbstractAdvancedEventListingPage(AbstractListingPage): help_text="Leave empty to show all events.", blank=True, # Explicit `db_table` required to avoid errors creating FK constraints - db_table="advanced_event_listing_page_secondary_types", + #db_table="advanced_event_listing_page_secondary_types", related_name="+", ) limit_to_locations = models.ManyToManyField( @@ -34,7 +34,7 @@ class AbstractAdvancedEventListingPage(AbstractListingPage): help_text="Leave empty to show all events.", blank=True, # Explicit `db_table` required to avoid errors creating FK constraints - db_table="advanced_event_listing_page_locations", + #db_table="advanced_event_listing_page_locations", ) limit_to_home_locations = models.BooleanField( default=False,