Add field "enabled" to Report template

This commit is contained in:
Oliver Walters 2020-08-23 20:51:41 +10:00
parent 116d966d29
commit b7ae95686e
3 changed files with 25 additions and 1 deletions

View File

@ -8,7 +8,7 @@ from .models import TestReport, ReportAsset
class ReportTemplateAdmin(admin.ModelAdmin):
list_display = ('name', 'description', 'template')
list_display = ('name', 'description', 'template', 'enabled')
class ReportAssetAdmin(admin.ModelAdmin):

View File

@ -0,0 +1,18 @@
# Generated by Django 3.0.7 on 2020-08-23 10:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('report', '0002_delete_reporttemplate'),
]
operations = [
migrations.AddField(
model_name='testreport',
name='enabled',
field=models.BooleanField(default=True, help_text='Report template is enabled', verbose_name='Enabled'),
),
]

View File

@ -147,6 +147,12 @@ class ReportTemplateBase(models.Model):
description = models.CharField(max_length=250, help_text=_("Report template description"))
enabled = models.BooleanField(
default=True,
help_text=_('Report template is enabled'),
verbose_name=_('Enabled')
)
class Meta:
abstract = True