# Generated by Django 3.2 on 2022-02-04 11:22

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Poll',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('question', models.CharField(max_length=120, verbose_name='عنوان سوال')),
                ('active', models.BooleanField(default=False, verbose_name='فعال / غیرفعال')),
                ('for_user', models.CharField(choices=[('all', 'همه'), ('teacher', 'دبیران'), ('parent', 'والدین'), ('student', 'دانش آموزان')], default='all', max_length=20, verbose_name='برای کاربران')),
                ('create', models.DateTimeField(default=django.utils.timezone.now, verbose_name='زمان ساخت')),
                ('users', models.ManyToManyField(blank=True, related_name='poll_user', to=settings.AUTH_USER_MODEL, verbose_name='کاربران')),
            ],
            options={
                'verbose_name': 'نظرسنجی',
                'verbose_name_plural': '1. نظرسنجی ها',
                'ordering': ('-create',),
            },
        ),
        migrations.CreateModel(
            name='PollOptions',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('option', models.CharField(max_length=120, verbose_name='گزینه')),
                ('option_count', models.IntegerField(default=0, verbose_name='شمارش گزینه')),
                ('poll', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='poll_option', to='poll.poll', verbose_name='برای نظرسنجی')),
            ],
            options={
                'verbose_name': 'گزینه',
                'verbose_name_plural': '2. گزینه ها',
            },
        ),
    ]
