From 17b9950ed2dc9181c5378d26dd70343d2b7ff47e Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Thu, 30 Jan 2025 12:15:12 -0400
Subject: [PATCH] feat: rename model ContentLicense -> Licensing

---
 .../0146_rename_contentlicense_licensing.py    | 17 +++++++++++++++++
 ...7_rename_content_license_image_licensing.py | 18 ++++++++++++++++++
 program/models.py                              |  6 +++---
 3 files changed, 38 insertions(+), 3 deletions(-)
 create mode 100644 program/migrations/0146_rename_contentlicense_licensing.py
 create mode 100644 program/migrations/0147_rename_content_license_image_licensing.py

diff --git a/program/migrations/0146_rename_contentlicense_licensing.py b/program/migrations/0146_rename_contentlicense_licensing.py
new file mode 100644
index 0000000..69d60f3
--- /dev/null
+++ b/program/migrations/0146_rename_contentlicense_licensing.py
@@ -0,0 +1,17 @@
+# Generated by Django 4.2.18 on 2025-01-30 14:51
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ("program", "0145_alter_timeslot_options"),
+    ]
+
+    operations = [
+        migrations.RenameModel(
+            old_name="ContentLicense",
+            new_name="Licensing",
+        ),
+    ]
diff --git a/program/migrations/0147_rename_content_license_image_licensing.py b/program/migrations/0147_rename_content_license_image_licensing.py
new file mode 100644
index 0000000..5e6f895
--- /dev/null
+++ b/program/migrations/0147_rename_content_license_image_licensing.py
@@ -0,0 +1,18 @@
+# Generated by Django 4.2.18 on 2025-01-30 14:52
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ("program", "0146_rename_contentlicense_licensing"),
+    ]
+
+    operations = [
+        migrations.RenameField(
+            model_name="image",
+            old_name="content_license",
+            new_name="licensing",
+        ),
+    ]
diff --git a/program/models.py b/program/models.py
index 89fadb0..e4040a5 100644
--- a/program/models.py
+++ b/program/models.py
@@ -144,7 +144,7 @@ class License(models.Model):
         return self.identifier
 
 
-class ContentLicense(models.Model):
+class Licensing(models.Model):
     credits = models.TextField(blank=True, default="", help_text="Credits of the content.")
     is_use_explicitly_granted_by_author = models.BooleanField(
         default=False,
@@ -173,8 +173,8 @@ class Image(models.Model):
         width_field="width",
         help_text="The URI of the image.",
     )
-    content_license = models.ForeignKey(
-        ContentLicense,
+    licensing = models.ForeignKey(
+        Licensing,
         null=True,
         on_delete=models.SET_NULL,
         related_name="images",
-- 
GitLab