Skip to content

Commit

Permalink
personal: Downgrade from ClusterableModel to Model
Browse files Browse the repository at this point in the history
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
  • Loading branch information
donald committed Feb 9, 2025
1 parent 05a33eb commit e234782
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions mpicms/personal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down

0 comments on commit e234782

Please sign in to comment.