Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure all content models have Drupal migration metadata #729

Merged
merged 8 commits into from
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added common/__init__.py
Empty file.
1 change: 1 addition & 0 deletions common/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Register your models here.
6 changes: 6 additions & 0 deletions common/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class CommonConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "common"
Empty file added common/migrations/__init__.py
Empty file.
10 changes: 10 additions & 0 deletions common/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.db import models


class DrupalFields(models.Model):
drupal_node_id = models.IntegerField(null=True, blank=True)
drupal_body_migrated = models.TextField(null=True, blank=True)
drupal_path = models.CharField(max_length=255, null=True, blank=True)

class Meta:
abstract = True
1 change: 1 addition & 0 deletions common/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Create your tests here.
1 change: 1 addition & 0 deletions common/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Create your views here.
17 changes: 17 additions & 0 deletions community/migrations/0016_onlineworship_drupal_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.1 on 2023-06-22 19:58

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("community", "0015_onlineworship_online_worship_day_and_more"),
]

operations = [
migrations.AddField(
model_name="onlineworship",
name="drupal_path",
field=models.CharField(blank=True, max_length=255, null=True),
),
]
3 changes: 2 additions & 1 deletion community/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from timezone_field import TimeZoneField # type: ignore

from blocks import blocks as wf_blocks
from common.models import DrupalFields


class CommunityPage(Page):
Expand Down Expand Up @@ -48,7 +49,7 @@ class CommunityPage(Page):
]


class OnlineWorship(Page):
class OnlineWorship(DrupalFields, Page):
class OnlineWorshipDayChoices(models.TextChoices):
SUNDAY = "Sunday", "Sunday"
MONDAY = "Monday", "Monday"
Expand Down
1 change: 1 addition & 0 deletions core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"accounts",
"addresses",
"cart",
"common",
"community",
"contact",
"content_migration",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.2.1 on 2023-06-22 19:58

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("documents", "0013_alter_publicboarddocument_category"),
]

operations = [
migrations.AddField(
model_name="meetingdocument",
name="drupal_body_migrated",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="meetingdocument",
name="drupal_path",
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name="publicboarddocument",
name="drupal_body_migrated",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="publicboarddocument",
name="drupal_path",
field=models.CharField(blank=True, max_length=255, null=True),
),
]
5 changes: 3 additions & 2 deletions documents/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from documents.blocks import DocumentEmbedBlock

from blocks import blocks as wf_blocks
from common.models import DrupalFields


class MeetingDocumentIndexPage(Page):
Expand Down Expand Up @@ -35,7 +36,7 @@ def get_context(self, request):
return context


class MeetingDocument(Page):
class MeetingDocument(DrupalFields, Page):
class MeetingDocmentTypeChoices(models.TextChoices):
EPISTLE = (
"epistle",
Expand Down Expand Up @@ -154,7 +155,7 @@ class PublicBoardDocumentIndexPage(Page):
]


class PublicBoardDocument(Page):
class PublicBoardDocument(DrupalFields, Page):
class PublicBoardDocmentCategoryChoices(models.TextChoices):
CORPORATION_DOCUMENTS_CURRENT_YEAR = (
"corporation_documents_current_year",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.2.1 on 2023-06-22 19:58

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("events", "0001_squashed_0018_eventsponsor"),
]

operations = [
migrations.AddField(
model_name="event",
name="drupal_body_migrated",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="event",
name="drupal_path",
field=models.CharField(blank=True, max_length=255, null=True),
),
]
3 changes: 2 additions & 1 deletion events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from wagtail.search import index

from blocks.blocks import FormattedImageChooserStructBlock, HeadingBlock, SpacerBlock
from common.models import DrupalFields


class EventSponsor(Orderable):
Expand All @@ -34,7 +35,7 @@ class EventSponsor(Orderable):
]


class Event(Page):
class Event(DrupalFields, Page):
class EventCategoryChoices(models.TextChoices):
WESTERN = ("western", "Western")
OTHER = ("other", "Other")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.2.1 on 2023-06-22 19:58

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("library", "0017_alter_libraryitem_body"),
]

operations = [
migrations.AddField(
model_name="libraryitem",
name="drupal_body_migrated",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="libraryitem",
name="drupal_path",
field=models.CharField(blank=True, max_length=255, null=True),
),
]
3 changes: 2 additions & 1 deletion library/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
SpacerBlock,
WfURLBlock,
)
from common.models import DrupalFields
from documents.blocks import DocumentEmbedBlock
from facets.models import Audience, Genre, Medium, TimePeriod, Topic

Expand All @@ -34,7 +35,7 @@ class LibraryItemTag(TaggedItemBase):
)


class LibraryItem(Page):
class LibraryItem(DrupalFields, Page):
publication_date = models.DateField("Publication date", null=True, blank=True)
publication_date_is_approximate = models.BooleanField(
default=False,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Generated by Django 4.2.1 on 2023-06-22 19:58

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("magazine", "0025_alter_archivearticleauthor_options_and_more"),
]

operations = [
migrations.AddField(
model_name="archiveissue",
name="drupal_body_migrated",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="archiveissue",
name="drupal_node_id",
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name="archiveissue",
name="drupal_path",
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name="magazinearticle",
name="drupal_body_migrated",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="magazinearticle",
name="drupal_path",
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name="magazineissue",
name="drupal_body_migrated",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="magazineissue",
name="drupal_path",
field=models.CharField(blank=True, max_length=255, null=True),
),
]
7 changes: 4 additions & 3 deletions magazine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
PullQuoteBlock,
SpacerBlock,
)
from common.models import DrupalFields
from documents.blocks import DocumentEmbedBlock

from .panels import NestedInlinePanel
Expand Down Expand Up @@ -112,7 +113,7 @@ def get_context(self, request, *args, **kwargs):
return context


class MagazineIssue(Page):
class MagazineIssue(DrupalFields, Page):
cover_image = models.ForeignKey(
"wagtailimages.Image",
on_delete=models.SET_NULL,
Expand Down Expand Up @@ -228,7 +229,7 @@ def __str__(self):
return self.title


class MagazineArticle(Page):
class MagazineArticle(DrupalFields, Page):
teaser = RichTextField(
blank=True,
help_text="Try to keep teaser to a couple dozen words.",
Expand Down Expand Up @@ -455,7 +456,7 @@ class Meta:
]


class ArchiveIssue(Page):
class ArchiveIssue(DrupalFields, Page):
publication_date = models.DateField(
null=True, help_text="Please select the first day of the publication month"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.2.1 on 2023-06-22 19:58

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("memorials", "0001_squashed_0002_alter_memorial_options"),
]

operations = [
migrations.AddField(
model_name="memorial",
name="drupal_body_migrated",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="memorial",
name="drupal_node_id",
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name="memorial",
name="drupal_path",
field=models.CharField(blank=True, max_length=255, null=True),
),
]
3 changes: 2 additions & 1 deletion memorials/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from wagtail.models import Page

from contact.models import Meeting
from common.models import DrupalFields


class Memorial(Page):
class Memorial(DrupalFields, Page):
memorial_person = models.ForeignKey(
to="contact.Person",
on_delete=models.PROTECT,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.2.1 on 2023-06-22 19:58

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("news", "0021_alter_newsitem_body"),
]

operations = [
migrations.AddField(
model_name="newsitem",
name="drupal_body_migrated",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="newsitem",
name="drupal_path",
field=models.CharField(blank=True, max_length=255, null=True),
),
]
3 changes: 2 additions & 1 deletion news/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
PullQuoteBlock,
SpacerBlock,
)
from common.models import DrupalFields
from documents.blocks import DocumentEmbedBlock


Expand Down Expand Up @@ -139,7 +140,7 @@ class NewsItemTag(TaggedItemBase):
)


class NewsItem(Page):
class NewsItem(DrupalFields, Page):
teaser = models.TextField(
max_length=100,
null=True,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.2.1 on 2023-06-22 19:58

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("wf_pages", "0018_alter_wfpage_body"),
]

operations = [
migrations.AddField(
model_name="wfpage",
name="drupal_body_migrated",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="wfpage",
name="drupal_path",
field=models.CharField(blank=True, max_length=255, null=True),
),
]
Loading