# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-30 16:23
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django_smalluuid.models
import everyvoter_common.utils.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('branding', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Election',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('election_type', models.CharField(choices=[(b'primary', b'Federal Primary'), (b'general', b'Federal General'), (b'special', b'Federal Special')], max_length=50, verbose_name=b'Election Type')),
                ('election_date', models.DateField(verbose_name=b'Election Date')),
                ('vr_deadline', models.DateField(blank=True, help_text=b'The deadline by which voters in the state must register to vote', null=True, verbose_name=b'Voter Registration Deadline')),
                ('vr_deadline_online', models.DateField(blank=True, help_text=b'The explicit deadline by which voters in the state must register to vote online in order to vote', null=True, verbose_name=b'Online Voter Registration Deadline')),
                ('evip_start_date', models.DateField(blank=True, help_text=b'The date in which early voting in person begins in the state', null=True, verbose_name=b'Early Vote In-Person Start Date')),
                ('evip_close_date', models.DateField(blank=True, help_text=b'The date that early voting in person ends in the state', null=True, verbose_name=b'Early Vote In-Person Close Date')),
                ('vbm_application_deadline', models.DateField(null=True, blank=True, help_text=b'the date by which voters must return their applications applying to vote by mail', verbose_name=b'Vote By Mail Application Deadline')),
                ('vbm_return_date', models.DateField(null=True, blank=True, help_text=b'The date by which voters must return their mailed ballots', verbose_name=b'Vote By Mail Ballot Return Date')),
                ('ev_notes', models.TextField(blank=True)),
                ('vr_notes', models.TextField(blank=True)),
            ],
            options={'abstract': False, 'ordering': ['election_type', 'state_id'], 'verbose_name': 'Election', 'verbose_name_plural': 'Elections'},
            bases=(everyvoter_common.utils.models.CacheMixinModel, models.Model),
        ),
        migrations.CreateModel(
            name='LegislativeDistrict',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=150, verbose_name=b'Name')),
                ('ocd_id', models.CharField(max_length=100, verbose_name=b'OCD ID')),
                ('district_type', models.CharField(choices=[(b'state', b'State'), (b'cd', b'Congressional District'), (b'stateleg_upper', b'State Senate/Upper State'), (b'stateleg_lower', b'State Rep/Lower State')], max_length=50, verbose_name=b'District Type')),
            ],
            options={
                'abstract': False,
            },
            bases=(everyvoter_common.utils.models.CacheMixinModel, models.Model),
        ),
        migrations.CreateModel(
            name='OrganizationElection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('uuid', django_smalluuid.models.SmallUUIDField(db_index=True, default=django_smalluuid.models.UUIDDefault(), editable=False, unique=True)),
                ('vbm_active', models.BooleanField(default=True, verbose_name=b'Vote By Mail Notifications')),
                ('evip_active', models.BooleanField(default=True, verbose_name=b'Early Vote In Person Notifications')),
                ('vr_active', models.BooleanField(default=True, verbose_name=b'Voter Registration Notifications')),
                ('eday_active', models.BooleanField(default=True, verbose_name=b'Election Day Notifications')),
                ('election', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='election.Election')),
                ('organization', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='branding.Organization')),
            ],
            bases=(everyvoter_common.utils.models.CacheMixinModel, models.Model),
        ),
        migrations.CreateModel(
            name='State',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('code', models.CharField(choices=[(b'AL', b'AL'), (b'AK', b'AK'), (b'AZ', b'AZ'), (b'AR', b'AR'), (b'CA', b'CA'), (b'CO', b'CO'), (b'CT', b'CT'), (b'DE', b'DE'), (b'FL', b'FL'), (b'GA', b'GA'), (b'HI', b'HI'), (b'ID', b'ID'), (b'IL', b'IL'), (b'IN', b'IN'), (b'IA', b'IA'), (b'KS', b'KS'), (b'KY', b'KY'), (b'LA', b'LA'), (b'ME', b'ME'), (b'MD', b'MD'), (b'MA', b'MA'), (b'MI', b'MI'), (b'MN', b'MN'), (b'MS', b'MS'), (b'MO', b'MO'), (b'MT', b'MT'), (b'NE', b'NE'), (b'NV', b'NV'), (b'NH', b'NH'), (b'NJ', b'NJ'), (b'NM', b'NM'), (b'NY', b'NY'), (b'NC', b'NC'), (b'ND', b'ND'), (b'OH', b'OH'), (b'OK', b'OK'), (b'OR', b'OR'), (b'PA', b'PA'), (b'RI', b'RI'), (b'SC', b'SC'), (b'SD', b'SD'), (b'TN', b'TN'), (b'TX', b'TX'), (b'UT', b'UT'), (b'VT', b'VT'), (b'VA', b'VA'), (b'WA', b'WA'), (b'WV', b'WV'), (b'WI', b'WI'), (b'WY', b'WY'), (b'DC', b'DC')], editable=False, max_length=2, primary_key=True, serialize=False, verbose_name=b'Code')),
                ('name', models.CharField(max_length=50, verbose_name=b'Name')),
                ('is_state', models.BooleanField(help_text=b'Whether locale is a state')),
                ('senate_2018', models.BooleanField(help_text=b'Whether at least 1 U.S. Senate seat in the state will appear on the general election ballot')),
                ('governor_2018', models.BooleanField(help_text=b"Whether the state's Governor's seat will appear on the general election ballot")),
                ('has_vr', models.BooleanField(help_text=b"Whether the state registers voters (North Dakota doesn't)")),
                ('automatic_vr', models.BooleanField(help_text=b'Whether the state offers automatic voter registration')),
                ('online_vr', models.BooleanField(help_text=b'Whether the state offers online voter registration')),
                ('same_day_vr', models.BooleanField(help_text=b'Whether the state offers same day voter registration, defined here as the ability to register to vote and also cast a vote prior to election day')),
                ('eday_vr', models.BooleanField(help_text=b'Whether the state offers election day voter registration, defined here as the ability to register to vote and also cast a vote on election day')),
                ('early_vote_in_person', models.BooleanField(help_text=b'Whether the state offers some form of voting prior to election day via a personal appearance')),
                ('in_person_absentee', models.BooleanField(help_text=b'Whether the only form of voting prior to election day via personal appearance is at a single location per jurisdiction')),
                ('early_vote_by_mail', models.BooleanField(help_text=b'Whether the state allows for voting by mail prior to election day')),
                ('early_vote_by_mail_fault', models.BooleanField(help_text=b'Whether there are restrictions as to who can vote by mail prior to election day')),
                ('early_vote_by_county', models.BooleanField(help_text=b'Whether the availability or dates of early votes is county-by-county')),
                ('perm_absentee', models.BooleanField(help_text=b'Whether the state offers a permanent absentee option in which a voter can either elect (or will automatically receive) a mail ballot')),
                ('election_calendar_url', models.URLField(blank=True)),
                ('notes', models.TextField(blank=True)),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'State',
                'verbose_name_plural': 'States',
            },
            bases=(everyvoter_common.utils.models.CacheMixinModel, models.Model),
        ),
        migrations.AddField(
            model_name='legislativedistrict',
            name='state',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='election.State'),
        ),
        migrations.AddField(
            model_name='election',
            name='state',
            field=models.ForeignKey(help_text=b'State under whose rules the election follows.', on_delete=django.db.models.deletion.CASCADE, to='election.State'),
        ),
        migrations.AddField(
            model_name='election',
            name='voting_districts',
            field=models.ManyToManyField(help_text=b'One or more districts voting in the election (i.e. who should get information about this election)', to='election.LegislativeDistrict', verbose_name=b'Voting Districts'),
        ),
        migrations.AlterUniqueTogether(
            name='organizationelection',
            unique_together=set([('organization', 'election')]),
        ),
    ]
