From 6d27add8438e271fcdde120133524207650efae0 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 14 Jun 2022 22:30:39 +0100 Subject: [PATCH] Use Django's method for class properties --- website/common/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/common/models.py b/website/common/models.py index d21f042..0ca821c 100644 --- a/website/common/models.py +++ b/website/common/models.py @@ -1,4 +1,5 @@ from django.db import models +from django.utils.functional import classproperty from wagtail.admin.panels import FieldPanel from wagtail.models import Page @@ -7,8 +8,7 @@ class BasePage(Page): class Meta: abstract = True - @classmethod - @property + @classproperty def body_class(cls) -> str: return "page-" + cls._meta.db_table.replace("_", "-")