14132 add description, comments fields

This commit is contained in:
Arthur 2023-11-16 11:19:02 -08:00
parent ca0a567081
commit 22c11c8123
2 changed files with 31 additions and 17 deletions

View File

@ -50,6 +50,7 @@ class Migration(migrations.Migration):
models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
),
('name', models.CharField(max_length=150, unique=True)),
('description', models.CharField(blank=True, max_length=200)),
('type_create', models.BooleanField(default=False)),
('type_update', models.BooleanField(default=False)),
('type_delete', models.BooleanField(default=False)),
@ -59,24 +60,9 @@ class Migration(migrations.Migration):
('conditions', models.JSONField(blank=True, null=True)),
('action_type', models.CharField(default='webhook', max_length=30)),
('action_object_id', models.PositiveBigIntegerField(blank=True, null=True)),
(
'content_types',
models.ManyToManyField(
related_name='eventrules',
to='contenttypes.contenttype',
),
),
(
'action_object_type',
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='eventrule_actions',
to='contenttypes.contenttype',
),
),
('action_parameters', models.CharField(max_length=80, blank=True)),
('action_parameters', models.CharField(blank=True, max_length=80)),
('action_data', models.JSONField(blank=True, null=True)),
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
('comments', models.TextField(blank=True)),
],
options={
'verbose_name': 'eventrule',
@ -121,4 +107,23 @@ class Migration(migrations.Migration):
model_name='webhook',
name='type_update',
),
migrations.AddField(
model_name='eventrule',
name='action_object_type',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='eventrule_actions',
to='contenttypes.contenttype',
),
),
migrations.AddField(
model_name='eventrule',
name='content_types',
field=models.ManyToManyField(related_name='eventrules', to='contenttypes.contenttype'),
),
migrations.AddField(
model_name='eventrule',
name='tags',
field=taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag'),
),
]

View File

@ -56,6 +56,11 @@ class EventRule(CustomFieldsMixin, ExportTemplatesMixin, TagsMixin, ChangeLogged
max_length=150,
unique=True
)
description = models.CharField(
verbose_name=_('description'),
max_length=200,
blank=True
)
type_create = models.BooleanField(
verbose_name=_('on create'),
default=False,
@ -123,6 +128,10 @@ class EventRule(CustomFieldsMixin, ExportTemplatesMixin, TagsMixin, ChangeLogged
null=True,
help_text=_("Parameters to pass to the action.")
)
comments = models.TextField(
verbose_name=_('comments'),
blank=True
)
class Meta:
ordering = ('name',)