From f094ace862ae9ee52ace37772ce4e5dcac853a36 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Sun, 2 Jan 2022 20:53:33 +0000 Subject: [PATCH] Make level description a text field --- .../migrations/0012_auto_20220102_2051.py | 23 +++++++++++++++++++ training/models.py | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 training/migrations/0012_auto_20220102_2051.py diff --git a/training/migrations/0012_auto_20220102_2051.py b/training/migrations/0012_auto_20220102_2051.py new file mode 100644 index 00000000..bc337d50 --- /dev/null +++ b/training/migrations/0012_auto_20220102_2051.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.13 on 2022-01-02 20:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('training', '0011_auto_20220102_1106'), + ] + + operations = [ + migrations.AlterField( + model_name='traininglevel', + name='department', + field=models.IntegerField(blank=True, choices=[(0, 'Sound'), (1, 'Lighting'), (2, 'Power'), (3, 'Rigging'), (4, 'Haulage')], null=True), + ), + migrations.AlterField( + model_name='traininglevel', + name='description', + field=models.TextField(blank=True), + ), + ] diff --git a/training/models.py b/training/models.py index 7cbbd67f..28504d25 100644 --- a/training/models.py +++ b/training/models.py @@ -127,7 +127,7 @@ class TrainingItemQualification(models.Model): # Levels @reversion.register(follow=["requirements"]) class TrainingLevel(models.Model, RevisionMixin): - description = models.CharField(max_length=120, blank=True) + description = models.TextField(blank=True) TA = 0 TECHNICIAN = 1 SUPERVISOR = 2 @@ -148,7 +148,7 @@ class TrainingLevel(models.Model, RevisionMixin): (RIGGING, 'Rigging'), (HAULAGE, 'Haulage'), ) - department = models.IntegerField(choices=DEPARTMENTS, null=True) # N.B. Technical Assistant does not have a department + department = models.IntegerField(choices=DEPARTMENTS, null=True, blank=True) # N.B. Technical Assistant does not have a department level = models.IntegerField(choices=CHOICES) prerequisite_levels = models.ManyToManyField('self', related_name='prerequisites', symmetrical=False, blank=True) icon = models.CharField(null=True, blank=True, max_length=20)