aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-05-15 21:02:51 +0100
committerMatthew Lemon <y@yulqen.org>2024-05-15 21:02:51 +0100
commitc20c72522539b794747c95a2b3d4f9b25a763f21 (patch)
tree2c0daebac51f8d54be232a0ac5a6d8ce401adac1
parentae42defca04b78516712c64be27ee5f91e1da03d (diff)
Fix additional resource field in update form
-rw-r--r--pyblackbird_cc/resources/migrations/0002_alter_resource_additional_resource_category_and_more.py24
-rw-r--r--pyblackbird_cc/resources/models.py2
2 files changed, 25 insertions, 1 deletions
diff --git a/pyblackbird_cc/resources/migrations/0002_alter_resource_additional_resource_category_and_more.py b/pyblackbird_cc/resources/migrations/0002_alter_resource_additional_resource_category_and_more.py
new file mode 100644
index 0000000..3b70450
--- /dev/null
+++ b/pyblackbird_cc/resources/migrations/0002_alter_resource_additional_resource_category_and_more.py
@@ -0,0 +1,24 @@
+# Generated by Django 5.0.4 on 2024-05-15 20:00
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('resources', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='resource',
+ name='additional_resource_category',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='additional_resource_category', to='resources.resourcecategory'),
+ ),
+ migrations.AlterField(
+ model_name='resource',
+ name='curriculum',
+ field=models.CharField(blank=True, choices=[('No curriculum', 'No curriculum'), ('English', 'English'), ('Scottish', 'Scottish')], default='English', max_length=20),
+ ),
+ ]
diff --git a/pyblackbird_cc/resources/models.py b/pyblackbird_cc/resources/models.py
index b11bcb9..6a279dd 100644
--- a/pyblackbird_cc/resources/models.py
+++ b/pyblackbird_cc/resources/models.py
@@ -36,6 +36,7 @@ class Resource(models.Model):
"ResourceCategory",
on_delete=models.CASCADE,
null=True,
+ blank=True,
related_name="additional_resource_category",
)
description = models.TextField(max_length=1000, null=False, blank=False)
@@ -48,7 +49,6 @@ class Resource(models.Model):
)
curriculum = models.CharField(
max_length=20,
- null=True,
default="English",
blank=True,
choices=[