thclark / wagtail_events

Events calendar management for wagtail
Other
10 stars 4 forks source link

Migrations hard coded to wagtail images model #3

Closed thclark closed 5 years ago

thclark commented 5 years ago

wagtail_events is a third party plugin, which defines in its models a relation to another third party plugin, wagtail images.

Where wagtail_events is added to a project, it should relate to whatever model is being used by wagtail to handle images, NOT by default to wagtail.images.models.Image.

Following this issue on SO it became clear that by using this hard coded default would cause huge problems with forking the migration history.

Solution

Change the initial migration to correctly use the setting WAGTAILIMAGES_IMAGE_MODEL so that foreign keys are always related to the correct model.