# Generated by Django 3.0b1 on 2019-11-18 10:00

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Language',
            fields=[
                ('iso', models.CharField(max_length=2, primary_key=True, serialize=False, unique=True)),
                ('is_active', models.BooleanField(default=True, verbose_name='Active')),
            ],
            options={
                'verbose_name': 'Language',
                'verbose_name_plural': 'Languages',
                'ordering': ['iso'],
            },
        ),
        migrations.CreateModel(
            name='TranslatableField',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Name field', max_length=250, verbose_name='Field name')),
                ('title', models.CharField(help_text="Name user's field", max_length=250, verbose_name='User field name')),
                ('content_type', models.ForeignKey(limit_choices_to=models.Q(_negated=True, app_label='tof'), on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
            options={
                'verbose_name': 'Translatable field',
                'verbose_name_plural': 'Translatable fields',
                'ordering': ('content_type', 'name'),
                'unique_together': {('content_type', 'name')},
            },
        ),
        migrations.CreateModel(
            name='Translation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField(help_text='First set the field')),
                ('value', models.TextField(help_text='Value field', verbose_name='Value')),
                ('content_type', models.ForeignKey(limit_choices_to=models.Q(_negated=True, app_label='tof'), on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('field', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='Translation', to='tof.TranslatableField')),
                ('lang', models.ForeignKey(limit_choices_to=models.Q(is_active=True), on_delete=django.db.models.deletion.CASCADE, related_name='Translation', to='tof.Language')),
            ],
            options={
                'verbose_name': 'Translation',
                'verbose_name_plural': 'Translation',
                'unique_together': {('content_type', 'object_id', 'field', 'lang')},
            },
        ),
    ]
