From c2396f6ff3d27e7b9e124bcb03a6153d406d680d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= <fpeters@entrouvert.com>
Date: Fri, 23 Jul 2021 13:22:13 +0200
Subject: [PATCH 2/5] general: introduce new template_name attribute on cells
 (#55792)

---
 .../0003_bookingcalendar_template_name.py     | 18 +++++
 .../0003_dashboardcell_template_name.py       | 18 +++++
 .../migrations/0018_auto_20210723_1318.py     | 28 ++++++++
 .../0005_familyinfoscell_template_name.py     | 18 +++++
 .../0005_recentdocumentscell_template_name.py | 18 +++++
 .../migrations/0004_auto_20210723_1318.py     | 18 +++++
 ...003_latestpageupdatescell_template_name.py | 18 +++++
 .../migrations/0044_auto_20210723_1318.py     | 48 +++++++++++++
 .../migrations/0015_auto_20210723_1324.py     | 18 +++++
 .../migrations/0006_auto_20210723_1318.py     | 18 +++++
 .../0010_searchcell_template_name.py          | 18 +++++
 .../wcs/migrations/0030_auto_20210723_1318.py | 68 +++++++++++++++++++
 combo/data/migrations/0001_initial.py         |  2 +-
 .../migrations/0047_auto_20210723_1318.py     | 63 +++++++++++++++++
 combo/data/models.py                          |  4 +-
 .../0003_profilecell_template_name.py         | 18 +++++
 16 files changed, 391 insertions(+), 2 deletions(-)
 create mode 100644 combo/apps/calendar/migrations/0003_bookingcalendar_template_name.py
 create mode 100644 combo/apps/dashboard/migrations/0003_dashboardcell_template_name.py
 create mode 100644 combo/apps/dataviz/migrations/0018_auto_20210723_1318.py
 create mode 100644 combo/apps/family/migrations/0005_familyinfoscell_template_name.py
 create mode 100644 combo/apps/fargo/migrations/0005_recentdocumentscell_template_name.py
 create mode 100644 combo/apps/gallery/migrations/0004_auto_20210723_1318.py
 create mode 100644 combo/apps/kb/migrations/0003_latestpageupdatescell_template_name.py
 create mode 100644 combo/apps/lingo/migrations/0044_auto_20210723_1318.py
 create mode 100644 combo/apps/maps/migrations/0015_auto_20210723_1324.py
 create mode 100644 combo/apps/notifications/migrations/0006_auto_20210723_1318.py
 create mode 100644 combo/apps/search/migrations/0010_searchcell_template_name.py
 create mode 100644 combo/apps/wcs/migrations/0030_auto_20210723_1318.py
 create mode 100644 combo/data/migrations/0047_auto_20210723_1318.py
 create mode 100644 combo/profile/migrations/0003_profilecell_template_name.py

diff --git a/combo/apps/calendar/migrations/0003_bookingcalendar_template_name.py b/combo/apps/calendar/migrations/0003_bookingcalendar_template_name.py
new file mode 100644
index 00000000..42d5d640
--- /dev/null
+++ b/combo/apps/calendar/migrations/0003_bookingcalendar_template_name.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('calendar', '0002_bookingcalendar_days_displayed'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='bookingcalendar',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/apps/dashboard/migrations/0003_dashboardcell_template_name.py b/combo/apps/dashboard/migrations/0003_dashboardcell_template_name.py
new file mode 100644
index 00000000..e9834bb1
--- /dev/null
+++ b/combo/apps/dashboard/migrations/0003_dashboardcell_template_name.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dashboard', '0002_auto_20180105_0846'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='dashboardcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/apps/dataviz/migrations/0018_auto_20210723_1318.py b/combo/apps/dataviz/migrations/0018_auto_20210723_1318.py
new file mode 100644
index 00000000..503b4f0e
--- /dev/null
+++ b/combo/apps/dataviz/migrations/0018_auto_20210723_1318.py
@@ -0,0 +1,28 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dataviz', '0017_text_to_jsonb'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='chartcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='chartngcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='gauge',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/apps/family/migrations/0005_familyinfoscell_template_name.py b/combo/apps/family/migrations/0005_familyinfoscell_template_name.py
new file mode 100644
index 00000000..a08b099c
--- /dev/null
+++ b/combo/apps/family/migrations/0005_familyinfoscell_template_name.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('family', '0004_familyinfoscell_last_update_timestamp'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='familyinfoscell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/apps/fargo/migrations/0005_recentdocumentscell_template_name.py b/combo/apps/fargo/migrations/0005_recentdocumentscell_template_name.py
new file mode 100644
index 00000000..90eb89bf
--- /dev/null
+++ b/combo/apps/fargo/migrations/0005_recentdocumentscell_template_name.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('fargo', '0004_recentdocumentscell_fargo_site'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='recentdocumentscell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/apps/gallery/migrations/0004_auto_20210723_1318.py b/combo/apps/gallery/migrations/0004_auto_20210723_1318.py
new file mode 100644
index 00000000..5618e361
--- /dev/null
+++ b/combo/apps/gallery/migrations/0004_auto_20210723_1318.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('gallery', '0003_gallerycell_title'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='gallerycell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/apps/kb/migrations/0003_latestpageupdatescell_template_name.py b/combo/apps/kb/migrations/0003_latestpageupdatescell_template_name.py
new file mode 100644
index 00000000..204979b0
--- /dev/null
+++ b/combo/apps/kb/migrations/0003_latestpageupdatescell_template_name.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('kb', '0002_auto_20200203_1137'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='latestpageupdatescell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/apps/lingo/migrations/0044_auto_20210723_1318.py b/combo/apps/lingo/migrations/0044_auto_20210723_1318.py
new file mode 100644
index 00000000..c939623c
--- /dev/null
+++ b/combo/apps/lingo/migrations/0044_auto_20210723_1318.py
@@ -0,0 +1,48 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('lingo', '0043_auto_20210628_1849'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='activeitems',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='itemshistory',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='lingobasketcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='lingobasketlinkcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='lingorecenttransactionscell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='selfdeclaredinvoicepayment',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='tipipaymentformcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/apps/maps/migrations/0015_auto_20210723_1324.py b/combo/apps/maps/migrations/0015_auto_20210723_1324.py
new file mode 100644
index 00000000..e095f19e
--- /dev/null
+++ b/combo/apps/maps/migrations/0015_auto_20210723_1324.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:24
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('maps', '0014_geojson_circle_param'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='map',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/apps/notifications/migrations/0006_auto_20210723_1318.py b/combo/apps/notifications/migrations/0006_auto_20210723_1318.py
new file mode 100644
index 00000000..336e4b6e
--- /dev/null
+++ b/combo/apps/notifications/migrations/0006_auto_20210723_1318.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('notifications', '0005_auto_20180324_0025'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='notificationscell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/apps/search/migrations/0010_searchcell_template_name.py b/combo/apps/search/migrations/0010_searchcell_template_name.py
new file mode 100644
index 00000000..38fc2bb4
--- /dev/null
+++ b/combo/apps/search/migrations/0010_searchcell_template_name.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('search', '0009_text_to_jsonb'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='searchcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/apps/wcs/migrations/0030_auto_20210723_1318.py b/combo/apps/wcs/migrations/0030_auto_20210723_1318.py
new file mode 100644
index 00000000..10cddda8
--- /dev/null
+++ b/combo/apps/wcs/migrations/0030_auto_20210723_1318.py
@@ -0,0 +1,68 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('wcs', '0029_cards_custom_title'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='backofficesubmissioncell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='categoriescell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='trackingcodeinputcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='wcscardinfoscell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='wcscardscell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='wcscareformscell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='wcscategorycell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='wcscurrentdraftscell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='wcscurrentformscell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='wcsformcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='wcsformsofcategorycell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/data/migrations/0001_initial.py b/combo/data/migrations/0001_initial.py
index 113c8809..1a68034b 100644
--- a/combo/data/migrations/0001_initial.py
+++ b/combo/data/migrations/0001_initial.py
@@ -56,7 +56,7 @@ class Migration(migrations.Migration):
                 ),
                 ('title', models.CharField(max_length=50, verbose_name='Title')),
                 ('slug', models.SlugField(verbose_name='Slug')),
-                ('template_name', models.CharField(max_length=50, verbose_name='Template')),
+                ('template_name', models.CharField(max_length=50, verbose_name='Page Template')),
                 ('order', models.PositiveIntegerField()),
                 (
                     'exclude_from_navigation',
diff --git a/combo/data/migrations/0047_auto_20210723_1318.py b/combo/data/migrations/0047_auto_20210723_1318.py
new file mode 100644
index 00000000..1807b6a1
--- /dev/null
+++ b/combo/data/migrations/0047_auto_20210723_1318.py
@@ -0,0 +1,63 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('data', '0046_text_to_jsonb'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='configjsoncell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='feedcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='fortunecell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='jsoncell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='linkcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='linklistcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='menucell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='parentcontentcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='textcell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+        migrations.AddField(
+            model_name='unlockmarkercell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
diff --git a/combo/data/models.py b/combo/data/models.py
index 632b7a67..c219564b 100644
--- a/combo/data/models.py
+++ b/combo/data/models.py
@@ -190,7 +190,7 @@ class Page(models.Model):
         ),
     )
     description = models.TextField(_('Description'), blank=True)
-    template_name = models.CharField(_('Template'), max_length=50)
+    template_name = models.CharField(_('Page Template'), max_length=50)
     parent = models.ForeignKey('self', on_delete=models.CASCADE, null=True, blank=True)
     order = models.PositiveIntegerField()
     exclude_from_navigation = models.BooleanField(_('Exclude from navigation'), default=True)
@@ -706,6 +706,7 @@ class CellBase(six.with_metaclass(CellMeta, models.Model)):
     order = models.PositiveIntegerField()
     slug = models.SlugField(_('Slug'), blank=True)
     extra_css_class = models.CharField(_('Extra classes for CSS styling'), max_length=100, blank=True)
+    template_name = models.CharField(_('Cell Template'), max_length=50, blank=True, null=True)
 
     public = models.BooleanField(_('Public'), default=True)
     # restricted_to_unlogged is actually an invert switch, it is used for mark
@@ -988,6 +989,7 @@ class CellBase(six.with_metaclass(CellMeta, models.Model)):
                 'extra_css_class',
                 'last_update_timestamp',
                 'restricted_to_unlogged',
+                'template_name',
             )
         ]
 
diff --git a/combo/profile/migrations/0003_profilecell_template_name.py b/combo/profile/migrations/0003_profilecell_template_name.py
new file mode 100644
index 00000000..812f4866
--- /dev/null
+++ b/combo/profile/migrations/0003_profilecell_template_name.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.21 on 2021-07-23 11:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('profile', '0002_profilecell'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='profilecell',
+            name='template_name',
+            field=models.CharField(blank=True, max_length=50, null=True, verbose_name='Cell Template'),
+        ),
+    ]
-- 
2.32.0

