From 8e284b54d88aa39cb56a7cd79d26f9f81eec6011 Mon Sep 17 00:00:00 2001 From: blag Date: Thu, 29 May 2025 14:31:49 -0700 Subject: [PATCH] Revert "Split out an AbstractTemplate model for easier reuse" (#154) This reverts commit 46be8fc7489963ac6a05920f8e6de7af039a8266. --- dbtemplates/models.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/dbtemplates/models.py b/dbtemplates/models.py index ca04070..aa87dcb 100644 --- a/dbtemplates/models.py +++ b/dbtemplates/models.py @@ -13,7 +13,7 @@ from django.template import TemplateDoesNotExist from django.utils.translation import gettext_lazy as _ -class AbstractTemplateMixin(models.Model): +class Template(models.Model): """ Defines a template model for use with the database template loader. The field ``name`` is the equivalent to the filename of a static template. @@ -32,7 +32,7 @@ class AbstractTemplateMixin(models.Model): on_site = CurrentSiteManager('sites') class Meta: - abstract = True + db_table = 'django_template' verbose_name = _('template') verbose_name_plural = _('templates') ordering = ('name',) @@ -62,13 +62,6 @@ class AbstractTemplateMixin(models.Model): super().save(*args, **kwargs) -class Template(AbstractTemplateMixin, models.Model): - class Meta(AbstractTemplateMixin.Meta): - db_table = 'django_template' - verbose_name = _('template') - verbose_name_plural = _('templates') - - def add_default_site(instance, **kwargs): """ Called via Django's signals to cache the templates, if the template