Change Circles.profiles to be a ParentalManyToManyField
This commit is contained in:
parent
418eba5623
commit
6a0f2239af
|
|
@ -3,6 +3,7 @@ from typing import Tuple
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.text import slugify
|
from django.utils.text import slugify
|
||||||
|
from modelcluster.models import ParentalManyToManyField
|
||||||
from wagtail.admin.panels import FieldPanel, PageChooserPanel
|
from wagtail.admin.panels import FieldPanel, PageChooserPanel
|
||||||
from wagtail.fields import RichTextField, StreamField
|
from wagtail.fields import RichTextField, StreamField
|
||||||
from wagtail.models import Page
|
from wagtail.models import Page
|
||||||
|
|
@ -108,7 +109,7 @@ class Circle(CourseBasePage):
|
||||||
|
|
||||||
goals = RichTextField(features=DEFAULT_RICH_TEXT_FEATURES_WITH_HEADER)
|
goals = RichTextField(features=DEFAULT_RICH_TEXT_FEATURES_WITH_HEADER)
|
||||||
|
|
||||||
profiles = models.ManyToManyField(CourseProfile, related_name="circles")
|
profiles = ParentalManyToManyField(CourseProfile, related_name="circles")
|
||||||
|
|
||||||
# base circles do never belong to a course profile and should also get displayed no matter what profile is chosen
|
# base circles do never belong to a course profile and should also get displayed no matter what profile is chosen
|
||||||
is_base_circle = models.BooleanField(default=False)
|
is_base_circle = models.BooleanField(default=False)
|
||||||
|
|
@ -125,6 +126,8 @@ class Circle(CourseBasePage):
|
||||||
content_panels = Page.content_panels + [
|
content_panels = Page.content_panels + [
|
||||||
FieldPanel("description"),
|
FieldPanel("description"),
|
||||||
FieldPanel("goals"),
|
FieldPanel("goals"),
|
||||||
|
FieldPanel("is_base_circle"),
|
||||||
|
FieldPanel("profiles"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_frontend_url(self):
|
def get_frontend_url(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue