From e234782584e1b5d8b6b0c67d705e6a4da8b8a2e4 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Sun, 9 Feb 2025 13:14:46 +0100 Subject: [PATCH] personal: Downgrade from ClusterableModel to Model We no longer need modelcluster for Groups and Contact, as they are edited seperately. Downgrade base class from modelcluster.models.ClusterableModel to django.db.models.Model --- mpicms/personal/models.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/mpicms/personal/models.py b/mpicms/personal/models.py index 1875852..66279fe 100644 --- a/mpicms/personal/models.py +++ b/mpicms/personal/models.py @@ -8,7 +8,6 @@ from wagtail.search import index from wagtail.snippets.edit_handlers import SnippetChooserPanel -from modelcluster.models import ClusterableModel from modelcluster.fields import ParentalKey @@ -75,7 +74,7 @@ class Meta: @register_snippet -class Group(index.Indexed, ClusterableModel): +class Group(index.Indexed, models.Model): slug = models.CharField(_("slug"), max_length=254) name = models.CharField(_("name"), max_length=254, blank=True) priority = models.PositiveSmallIntegerField( @@ -102,18 +101,7 @@ class Meta: # noqa @register_snippet -class Contact(index.Indexed, ClusterableModel): - """ - A Django model to store People objects. - It uses the `@register_snippet` decorator to allow it to be accessible - via the Snippets UI (e.g. /admin/snippets/base/people/) - `People` uses the `ClusterableModel`, which allows the relationship with - another model to be stored locally to the 'parent' model (e.g. a PageModel) - until the parent is explicitly saved. This allows the editor to use the - 'Preview' button, to preview the content, without saving the relationships - to the database. - https://github.com/wagtail/django-modelcluster - """ +class Contact(index.Indexed, models.Model): title = models.CharField(_("title"), max_length=15, blank=True) first_name = models.CharField(_("first name"), max_length=50, blank=True) last_name = models.CharField(_("last name"), max_length=50, blank=True)