<filename>core/migrations/0056_auto_20210211_1605.py
# Generated by Django 2.2.18 on 2021-02-11 16:05

import django.db.models.deletion
import modelcluster.contrib.taggit
import modelcluster.fields
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0055_auto_20210209_1102'),
    ]

    operations = [
        migrations.CreateModel(
            name='PersonalisationTradingBlocTag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='name')),
                ('slug', models.SlugField(max_length=100, unique=True, verbose_name='slug')),
            ],
            options={
                'verbose_name': 'Trading bloc tag for personalisation',
                'verbose_name_plural': 'Trading bloc tags for personalisation',
            },
        ),
        migrations.CreateModel(
            name='TradingBlocTaggedCaseStudy',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                (
                    'content_object',
                    modelcluster.fields.ParentalKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='trading_bloc_tagged_items',
                        to='core.CaseStudy',
                    ),
                ),
                (
                    'tag',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='trading_bloc_tagged_case_studies',
                        to='core.PersonalisationTradingBlocTag',
                    ),
                ),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='casestudy',
            name='trading_bloc_code_tags',
            field=modelcluster.contrib.taggit.ClusterTaggableManager(
                blank=True,
                help_text='A comma-separated list of tags.',
                through='core.TradingBlocTaggedCaseStudy',
                to='core.PersonalisationTradingBlocTag',
                verbose_name='Trading bloc tags',
            ),
        ),
    ]
