Skip to content
Snippets Groups Projects
Commit f7e8f5e0 authored by Radovan Krebs's avatar Radovan Krebs
Browse files

Add comments to pools and sandboxes

---v2
Add character limit to comments and squash migrations.

---v3
Delete old migration files

---v4
Create the migration again without squashing

---v5
Remove useless blank=True and remake migrations
parent 9f84a1f5
No related branches found
No related tags found
No related merge requests found
# Generated by Django 2.2.28 on 2023-09-19 11:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sandbox_instance_app', '0008_pool_size'),
]
operations = [
migrations.AddField(
model_name='pool',
name='comment',
field=models.TextField(default='', help_text='Comment about specifics of this pool', max_length=256),
),
migrations.AddField(
model_name='sandbox',
name='comment',
field=models.TextField(default='', help_text='Comment about specifics of this sandbox', max_length=256),
),
]
...@@ -40,6 +40,11 @@ class Pool(models.Model): ...@@ -40,6 +40,11 @@ class Pool(models.Model):
) )
created_by = models.ForeignKey(User, on_delete=models.PROTECT, null=True, created_by = models.ForeignKey(User, on_delete=models.PROTECT, null=True,
help_text='The user that created this pool.') help_text='The user that created this pool.')
comment = models.TextField(
default='',
max_length=256,
help_text='Comment about specifics of this pool'
)
class Meta: class Meta:
ordering = ['id'] ordering = ['id']
...@@ -94,6 +99,11 @@ class Sandbox(models.Model): ...@@ -94,6 +99,11 @@ class Sandbox(models.Model):
public_user_key = models.TextField( public_user_key = models.TextField(
help_text='Public key for management access.' help_text='Public key for management access.'
) )
comment = models.TextField(
default='',
max_length=256,
help_text='Comment about specifics of this sandbox'
)
class Meta: class Meta:
ordering = ['id'] ordering = ['id']
......
...@@ -31,7 +31,7 @@ class PoolSerializer(serializers.ModelSerializer): ...@@ -31,7 +31,7 @@ class PoolSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = models.Pool model = models.Pool
fields = ('id', 'definition_id', 'size', 'max_size', 'lock_id', 'rev', 'rev_sha', fields = ('id', 'definition_id', 'size', 'max_size', 'lock_id', 'rev', 'rev_sha',
'created_by', 'hardware_usage', 'definition') 'created_by', 'hardware_usage', 'definition', 'comment')
read_only_fields = ('id', 'size', 'lock', 'rev', 'rev_sha', 'created_by', 'hardware_usage', read_only_fields = ('id', 'size', 'lock', 'rev', 'rev_sha', 'created_by', 'hardware_usage',
'definition') 'definition')
...@@ -158,7 +158,7 @@ class SandboxSerializer(serializers.ModelSerializer): ...@@ -158,7 +158,7 @@ class SandboxSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = models.Sandbox model = models.Sandbox
fields = ('id', 'lock_id', 'allocation_unit_id') fields = ('id', 'lock_id', 'allocation_unit_id', 'comment')
read_only_fields = ('id', 'lock', 'allocation_unit_id') read_only_fields = ('id', 'lock', 'allocation_unit_id')
@staticmethod @staticmethod
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment