Skip to content

Commit

Permalink
wagtail: upgrade to 5.02
Browse files Browse the repository at this point in the history
  • Loading branch information
m4ra committed Feb 19, 2024
1 parent da83eb2 commit 0a90c28
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
3 changes: 2 additions & 1 deletion apps/cms/contacts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from wagtail.admin.panels import MultiFieldPanel
from wagtail.admin.panels import ObjectList
from wagtail.admin.panels import TabbedInterface
from wagtail.admin.panels import TitleFieldPanel
from wagtail.contrib.forms.forms import FormBuilder
from wagtail.contrib.forms.models import AbstractEmailForm
from wagtail.contrib.forms.models import AbstractFormField
Expand Down Expand Up @@ -195,7 +196,7 @@ def get_form_fields(self):
]

common_panels = [
FieldPanel("title"),
TitleFieldPanel("title"),
FieldPanel("slug"),
MultiFieldPanel(
[
Expand Down
5 changes: 3 additions & 2 deletions apps/cms/news/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from wagtail.admin.panels import FieldPanel
from wagtail.admin.panels import ObjectList
from wagtail.admin.panels import TabbedInterface
from wagtail.admin.panels import TitleFieldPanel
from wagtail.models import Page

from apps.contrib.translations import TranslatedField
Expand Down Expand Up @@ -46,7 +47,7 @@ def get_context(self, request):
FieldPanel("subtitle_en"),
]

common_panels = [FieldPanel("title"), FieldPanel("slug")]
common_panels = [TitleFieldPanel("title"), FieldPanel("slug")]

edit_handler = TabbedInterface(
[
Expand Down Expand Up @@ -116,7 +117,7 @@ class NewsPage(Page):
]

common_panels = [
FieldPanel("title"),
TitleFieldPanel("title"),
FieldPanel("image"),
FieldPanel("author"),
FieldPanel("slug"),
Expand Down
6 changes: 3 additions & 3 deletions apps/cms/pages/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from wagtail.admin.panels import ObjectList
from wagtail.admin.panels import PageChooserPanel
from wagtail.admin.panels import TabbedInterface
from wagtail.admin.panels import TitleFieldPanel
from wagtail.images.blocks import ImageChooserBlock
from wagtail.models import Page

Expand All @@ -20,7 +21,6 @@


class HomePage(Page):

image_1 = models.ForeignKey(
"a4_candy_cms_images.CustomImage",
null=True,
Expand Down Expand Up @@ -157,7 +157,7 @@ def random_image(self):
]

common_panels = [
FieldPanel("title"),
TitleFieldPanel("title"),
FieldPanel("slug"),
PageChooserPanel("form_page", "a4_candy_cms_contacts.FormPage"),
MultiFieldPanel(
Expand Down Expand Up @@ -293,7 +293,7 @@ class SimplePage(Page):

ru_content_panels = [FieldPanel("body_streamfield_ru")]

common_panels = [FieldPanel("title"), FieldPanel("slug")]
common_panels = [TitleFieldPanel("title"), FieldPanel("slug")]

edit_handler = TabbedInterface(
[
Expand Down
6 changes: 3 additions & 3 deletions apps/cms/use_cases/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from wagtail.admin.panels import ObjectList
from wagtail.admin.panels import PageChooserPanel
from wagtail.admin.panels import TabbedInterface
from wagtail.admin.panels import TitleFieldPanel
from wagtail.models import Page

from apps.contrib.translations import TranslatedField
Expand Down Expand Up @@ -82,7 +83,7 @@ def get_context(self, request):
]

common_panels = [
FieldPanel("title"),
TitleFieldPanel("title"),
FieldPanel("slug"),
FieldPanel("demo_link"),
PageChooserPanel("form_page", "a4_candy_cms_contacts.FormPage"),
Expand All @@ -100,7 +101,6 @@ def get_context(self, request):


class UseCasePage(Page):

category = models.CharField(max_length=2, choices=CATEGORY_CHOICES)

image = models.ForeignKey(
Expand Down Expand Up @@ -165,7 +165,7 @@ def get_context(self, request):
de_content_panels = [FieldPanel("title_de"), FieldPanel("body_streamfield_de")]

common_panels = [
FieldPanel("title"),
TitleFieldPanel("title"),
FieldPanel("image"),
FieldPanel("slug"),
FieldPanel("category"),
Expand Down
5 changes: 4 additions & 1 deletion changelog/7637_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
- import Site from wagtail.models instead of wagtail.core.models
- migration for WagtailImageField which extends Django’s ImageField to use Willow for image file handling

- wagtail from 4.2 to 5.0
- wagtail from 4.2 to 5.0x
- New field for choosing css themes
wagtail/users/migrations/0012_userprofile_theme.py
- Migrate FieldPanel to TitleFieldPanel for slug field sync functionality

- wagtail from 5.0 to 5.1.x
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ django-cloudflare-push==0.2.2
django_csp==3.7
django-parler==2.3
sentry-sdk==1.25.1
wagtail==5.0
wagtail==5.02
whitenoise==6.4.0
xmltodict==0.13.0
zeep==4.2.1
Expand Down

0 comments on commit 0a90c28

Please sign in to comment.