feat(itim): Add service template support

!43 #69
This commit is contained in:
2024-07-21 09:17:46 +09:30
parent eb320c4e95
commit 2a3373a19b
6 changed files with 100 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# Generated by Django 5.0.7 on 2024-07-20 20:40
# Generated by Django 5.0.7 on 2024-07-20 23:46
import access.fields
import access.models
@ -79,6 +79,7 @@ class Migration(migrations.Migration):
('is_global', models.BooleanField(default=False)),
('model_notes', models.TextField(blank=True, default=None, null=True, verbose_name='Notes')),
('id', models.AutoField(primary_key=True, serialize=False, unique=True)),
('is_template', models.BooleanField(default=False, help_text='Is this service to be used as a template', verbose_name='Template')),
('name', models.CharField(help_text='Name of the Service', max_length=50, verbose_name='Name')),
('config', models.JSONField(blank=True, default=None, help_text='Cluster Configuration', null=True, verbose_name='Configuration')),
('created', access.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False)),
@ -87,7 +88,8 @@ class Migration(migrations.Migration):
('dependent_service', models.ManyToManyField(blank=True, default=None, help_text='Services that this service depends upon', to='itim.service', verbose_name='Dependent Services')),
('device', models.ForeignKey(blank=True, default=None, help_text='Device the service is assigned to', null=True, on_delete=django.db.models.deletion.CASCADE, to='itam.device', verbose_name='Device')),
('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='access.organization', validators=[access.models.TenancyObject.validatate_organization_exists])),
('port', models.ManyToManyField(help_text='Port the service is available on', to='itim.port', verbose_name='Port')),
('port', models.ManyToManyField(blank=True, help_text='Port the service is available on', to='itim.port', verbose_name='Port')),
('template', models.ForeignKey(blank=True, default=None, help_text='Template this service uses', null=True, on_delete=django.db.models.deletion.CASCADE, to='itim.service', verbose_name='Template')),
],
options={
'verbose_name': 'Service',