mirror of
https://github.com/jazzband/django-dbtemplates.git
synced 2026-03-16 22:20:28 +00:00
Revert "Split out an AbstractTemplate model for easier reuse" (#154)
This reverts commit 46be8fc748.
This commit is contained in:
parent
05f1ee1193
commit
8e284b54d8
1 changed files with 2 additions and 9 deletions
|
|
@ -13,7 +13,7 @@ from django.template import TemplateDoesNotExist
|
||||||
from django.utils.translation import gettext_lazy as _
|
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.
|
Defines a template model for use with the database template loader.
|
||||||
The field ``name`` is the equivalent to the filename of a static template.
|
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')
|
on_site = CurrentSiteManager('sites')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
db_table = 'django_template'
|
||||||
verbose_name = _('template')
|
verbose_name = _('template')
|
||||||
verbose_name_plural = _('templates')
|
verbose_name_plural = _('templates')
|
||||||
ordering = ('name',)
|
ordering = ('name',)
|
||||||
|
|
@ -62,13 +62,6 @@ class AbstractTemplateMixin(models.Model):
|
||||||
super().save(*args, **kwargs)
|
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):
|
def add_default_site(instance, **kwargs):
|
||||||
"""
|
"""
|
||||||
Called via Django's signals to cache the templates, if the template
|
Called via Django's signals to cache the templates, if the template
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue