# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-08-28 21:33
from __future__ import unicode_literals

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("profiles", "__first__"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("nouns", "__first__"),
    ]

    operations = [
        migrations.CreateModel(
            name="Declaration",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_deleted", models.BooleanField(default=False)),
                ("deleted_at", models.DateTimeField(blank=True, null=True)),
                (
                    "declaration_type",
                    models.IntegerField(
                        choices=[
                            (0, "but"),
                            (1, "because"),
                            (2, "however"),
                            (3, "neutral"),
                        ],
                        default=3,
                        help_text="\n\nThe type of declaration. It can be: <ul> <li> but: An objection against the resolution. </li> <li> because: A reason for proof the resolution. </li> <li> however: An additional situation for the declaration. </li> </ul>",
                        verbose_name="Declaration Type",
                    ),
                ),
                (
                    "text",
                    models.TextField(
                        blank=True,
                        help_text="\nExample: We define happiness as a state of well-being, starting with being alive instead of dead.",
                        null=True,
                        validators=[django.core.validators.MaxLengthValidator(300)],
                        verbose_name="Declaration Content",
                    ),
                ),
                (
                    "sources",
                    models.TextField(
                        blank=True,
                        help_text="\nExample: Charles Darwin's The Origin of Species",
                        null=True,
                        verbose_name="Sources",
                    ),
                ),
                (
                    "is_approved",
                    models.BooleanField(default=True, verbose_name="Published"),
                ),
                ("collapsed", models.BooleanField(default=False)),
                ("sibling_count", models.IntegerField(default=1)),
                ("child_count", models.IntegerField(default=1)),
                ("max_sibling_count", models.IntegerField(default=1)),
                (
                    "date_creation",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("ip_address", models.CharField(blank=True, max_length=255, null=True)),
                ("weight", models.IntegerField(default=0)),
                (
                    "parent",
                    models.ForeignKey(
                        blank=True,
                        help_text="The parent of declaration. If you don't choose anything, it will be a main declaration.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="children",
                        to="declarations.Declaration",
                        verbose_name="Parent",
                    ),
                ),
            ],
            options={"abstract": False},
        ),
        migrations.CreateModel(
            name="Report",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "reason",
                    models.TextField(
                        help_text="Please explain why the declaration is a fallacy.",
                        null=True,
                        verbose_name="Reason",
                    ),
                ),
                (
                    "fallacy_type",
                    models.CharField(
                        choices=[
                            (b"BeggingTheQuestion,", "Begging The Question"),
                            (b"IrrelevantConclusion", "Irrelevant Conclusion"),
                            (
                                b"FallacyOfIrrelevantPurpose",
                                "Fallacy Of Irrelevant Purpose",
                            ),
                            (b"FallacyOfRedHerring", "Fallacy Of Red Herring"),
                            (b"ResolutionAgainstTheMan", "Resolution Against TheMan"),
                            (b"PoisoningTheWell", "Poisoning The Well"),
                            (b"FallacyOfTheBeard", "Fallacy Of The Beard"),
                            (b"FallacyOfSlipperySlope", "Fallacy Of Slippery Slope"),
                            (b"FallacyOfFalseCause", "Fallacy Of False Cause"),
                            (b"FallacyOfPreviousThis", "Fallacy Of Previous This"),
                            (b"JointEffect", "Joint Effect"),
                            (b"WrongDirection", "Wrong Direction"),
                            (b"FalseAnalogy", "False Analogy"),
                            (b"SlothfulInduction", "Slothful Induction"),
                            (b"AppealToBelief", "Appeal To Belief"),
                            (b"PragmaticFallacy", "Pragmatic Fallacy"),
                            (b"FallacyOfIsToOught", "Fallacy Of Is To Ought"),
                            (b"ResolutionFromForce", "Resolution From Force"),
                            (b"ResolutionToPity", "Resolution To Pity"),
                            (b"PrejudicialLanguage", "Prejudicial Language"),
                            (
                                b"FallacyOfSpecialPleading",
                                "Fallacy Of Special Pleading",
                            ),
                            (b"AppealToAuthority", "Appeal To Authority"),
                        ],
                        default=b"Wrong Direction",
                        help_text='\nYou have to choose a fallacy type. For more information, you can look at the <a href="https://en.wikipedia.org/wiki/List_of_fallacies">wikipedia entry</a> for fallacies.',
                        max_length=255,
                        null=True,
                        verbose_name="Fallacy Type",
                    ),
                ),
                (
                    "declaration",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="reports",
                        to="declarations.Declaration",
                    ),
                ),
                (
                    "reporter",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="reports",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Resolution",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_deleted", models.BooleanField(default=False)),
                ("deleted_at", models.DateTimeField(blank=True, null=True)),
                (
                    "title",
                    models.CharField(
                        help_text="\nThe main resolution. It will be arguable with own declarations. The Declarations can prove or rebuttal this resolution.<br> Examples: <ul> <li>Real art is for society, not for profit</li> <li>The meaning of life is 42</li> <li>Ethics man did what had to be done</li> </ul>\n",
                        max_length=512,
                        verbose_name="Resolution",
                    ),
                ),
                ("slug", models.SlugField(blank=True, max_length=512)),
                (
                    "description",
                    models.TextField(blank=True, null=True, verbose_name="Description"),
                ),
                (
                    "owner",
                    models.CharField(
                        blank=True,
                        help_text="\nThe owner of topic. It can be institution, person, book, or a paper. Examples: <ul> <li>On the Origin of Species</li> <li>Friedrich Nietzsche</li> <li>Piet Mondiran</li> <li>The Guardian</li> </ul>\n",
                        max_length=255,
                        null=True,
                        verbose_name="Original Discourse",
                    ),
                ),
                (
                    "sources",
                    models.TextField(
                        blank=True,
                        help_text="\nThe source of resolution. It can be a URL, a book, or a newspaper. It is important for reliability of main resolution.\n",
                        null=True,
                        verbose_name="Sources",
                    ),
                ),
                ("is_featured", models.BooleanField(default=False)),
                ("is_published", models.BooleanField(default=False)),
                ("is_public", models.BooleanField(default=True)),
                (
                    "date_creation",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                (
                    "date_modification",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("ip_address", models.CharField(blank=True, max_length=255, null=True)),
                (
                    "language",
                    models.CharField(
                        choices=[
                            (b"ar", b"ar"),
                            (b"cn", b"cn"),
                            (b"en", b"en"),
                            (b"es", b"es"),
                            (b"fr", b"fr"),
                            (b"ru", b"ru"),
                        ],
                        max_length=5,
                        null=True,
                    ),
                ),
                ("score", models.FloatField(blank=True, null=True)),
                (
                    "abstaining",
                    models.ManyToManyField(
                        related_name="abstaining", to="profiles.State"
                    ),
                ),
                (
                    "against",
                    models.ManyToManyField(related_name="against", to="profiles.State"),
                ),
                (
                    "in_favour",
                    models.ManyToManyField(
                        related_name="in_favour", to="profiles.State"
                    ),
                ),
                (
                    "nouns",
                    models.ManyToManyField(
                        blank=True, related_name="resolutions", to="nouns.Noun"
                    ),
                ),
                (
                    "related_nouns",
                    models.ManyToManyField(
                        blank=True, related_name="resolutions_related", to="nouns.Noun"
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="resolutions",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={"ordering": ["-date_creation"]},
        ),
        migrations.AddField(
            model_name="report",
            name="resolution",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="reports",
                to="declarations.Resolution",
            ),
        ),
        migrations.AddField(
            model_name="declaration",
            name="related_resolution",
            field=models.ForeignKey(
                blank=True,
                help_text="You can also associate your declaration with a resolution.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="related_declarations",
                to="declarations.Resolution",
                verbose_name="Related Resolution",
            ),
        ),
        migrations.AddField(
            model_name="declaration",
            name="resolution",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="declarations",
                to="declarations.Resolution",
            ),
        ),
        migrations.AddField(
            model_name="declaration",
            name="speaker",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="speaker_declarations",
                to="profiles.Speaker",
            ),
        ),
        migrations.AddField(
            model_name="declaration",
            name="supporters",
            field=models.ManyToManyField(
                related_name="supporting", to=settings.AUTH_USER_MODEL
            ),
        ),
    ]
