# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-10-26 20:57
from __future__ import unicode_literals

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import portal.event_calendar.models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='BikeType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True)),
                ('status', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Events',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('text', models.TextField()),
                ('url', models.URLField(blank=True, max_length=255)),
                ('reg_url', models.CharField(blank=True, max_length=255)),
                ('reg_status', models.BooleanField(default=False)),
                ('photo', models.ImageField(blank=True, max_length=255, null=True, upload_to=b'upload/events/')),
                ('icon', models.ImageField(blank=True, max_length=255, null=True, upload_to=b'upload/events/')),
                ('forum_url', models.URLField(blank=True, max_length=255, null=True)),
                ('gps_track', models.CharField(blank=True, max_length=255)),
                ('lat', models.DecimalField(blank=True, decimal_places=6, default=0, max_digits=9)),
                ('lng', models.DecimalField(blank=True, decimal_places=6, default=0, max_digits=9)),
                ('city', models.CharField(max_length=100)),
                ('description', models.TextField(blank=True)),
                ('date', models.DateTimeField()),
                ('duration', models.PositiveSmallIntegerField(default=1, help_text=b'\xd1\x82\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb0\xd0\xbb\xd1\x96\xd1\x81\xd1\x82\xd1\x8c \xd0\xb7\xd0\xb0\xd1\x85\xd0\xbe\xd0\xb4\xd1\x83, \xd0\xba\xd1\x96\xd0\xbb\xd1\x8c\xd0\xba\xd1\x96\xd1\x81\xd1\x82\xd1\x8c \xd0\xb4\xd0\xbd\xd1\x96\xd0\xb2')),
                ('pub_date', models.DateField(auto_now_add=True)),
            ],
            options={
                'ordering': ['date'],
            },
        ),
        migrations.CreateModel(
            name='EventType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('description', models.CharField(max_length=255)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='GroupBikeType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='RegEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fname', models.CharField(max_length=100)),
                ('lname', models.CharField(max_length=100)),
                ('sex', models.IntegerField(choices=[(1, b'\xd0\xa7\xd0\xbe\xd0\xbb\xd0\xbe\xd0\xb2\xd1\x96\xd0\xba'), (0, b'\xd0\x96\xd1\x96\xd0\xbd\xd0\xba\xd0\xb0')], default=1, help_text=b'\xd0\xa1\xd1\x82\xd0\xb0\xd1\x82\xd1\x8c')),
                ('nickname', models.CharField(blank=True, help_text=b'Nickname - \xd0\x9f\xd1\x80\xd1\x96\xd0\xb7\xd0\xb2\xd0\xb8\xd1\x81\xd1\x8c\xd0\xba\xd0\xbe', max_length=100)),
                ('email', models.EmailField(blank=True, max_length=254)),
                ('phone', models.CharField(max_length=100, validators=[portal.event_calendar.models.validate_phone])),
                ('country', models.CharField(default=b'\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0', max_length=100)),
                ('city', models.CharField(max_length=150)),
                ('club', models.CharField(blank=True, max_length=150)),
                ('birthday', models.DateField(blank=True, default=datetime.date(2000, 1, 1), help_text=b'\xd0\x92\xd0\xb8\xd0\xb1\xd0\xb5\xd1\x80\xd1\x96\xd1\x82\xd1\x8c \xd0\xb4\xd0\xb0\xd1\x82\xd1\x83 \xd0\xbd\xd0\xb0\xd1\x80\xd0\xbe\xd0\xb4\xd0\xb6\xd0\xb5\xd0\xbd\xd0\xbd\xd1\x8f: \xd0\x94\xd0\xb5\xd0\xbd\xd1\x8c/\xd0\x9c\xd1\x96\xd1\x81\xd1\x8f\xd1\x86\xd1\x8c/\xd0\xa0\xd1\x96\xd0\xba', null=True)),
                ('pay', models.FloatField(blank=True, help_text=b' \xd0\xb3\xd1\x80\xd0\xb8\xd0\xb2\xd0\xbd\xd1\x96', null=True)),
                ('pay_date', models.DateTimeField(blank=True, null=True)),
                ('pay_type', models.CharField(blank=True, choices=[(b'card', b'\xd0\x9e\xd0\xbf\xd0\xbb\xd0\xb0\xd1\x82\xd0\xb0 \xd0\xbd\xd0\xb0 \xd0\xba\xd0\xb0\xd1\x80\xd1\x82\xd0\xba\xd1\x83'), (b'shop', b'\xd0\x9e\xd0\xbf\xd0\xbb\xd0\xb0\xd1\x82\xd0\xb0 \xd0\xb2 \xd0\xbc\xd0\xb0\xd0\xb3\xd0\xb0\xd0\xb7\xd0\xb8\xd0\xbd\xd1\x96 Rivelo'), (b'any', b'\xd0\x86\xd0\xbd\xd1\x88\xd0\xb8\xd0\xb9 \xd0\xbc\xd0\xb5\xd1\x82\xd0\xbe\xd0\xb4 \xd0\xbe\xd0\xbf\xd0\xbb\xd0\xb0\xd1\x82\xd0\xb8')], max_length=50, null=True)),
                ('reg_code', models.CharField(blank=True, help_text=b'\xd0\x9a\xd0\xbe\xd0\xb4 \xd0\xb4\xd0\xbb\xd1\x8f \xd0\xbc\xd0\xbe\xd0\xb6\xd0\xbb\xd0\xb8\xd0\xb2\xd0\xbe\xd0\xb3\xd0\xbe \xd1\x80\xd0\xb5\xd0\xb4\xd0\xb0\xd0\xb3\xd1\x83\xd0\xb2\xd0\xb0\xd0\xbd\xd0\xbd\xd1\x8f \xd0\xb2\xd0\xb0\xd1\x88\xd0\xb8\xd1\x85 \xd0\xb4\xd0\xb0\xd0\xbd\xd0\xb8\xd1\x85', max_length=100)),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('status', models.BooleanField(default=False)),
                ('start_number', models.IntegerField(blank=True, default=0, help_text=b'\xd0\xa1\xd1\x82\xd0\xb0\xd1\x80\xd1\x82\xd0\xbe\xd0\xb2\xd0\xb8\xd0\xb9 \xd0\xbd\xd0\xbe\xd0\xbc\xd0\xb5\xd1\x80 \xd0\xb2\xd1\x96\xd0\xb4 1 \xd0\xb4\xd0\xbe 999')),
                ('description', models.TextField(blank=True)),
                ('start_status', models.BooleanField(default=False)),
                ('bike_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='event_calendar.BikeType')),
                ('event', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='event_calendar.Events')),
            ],
            options={
                'ordering': ['date'],
            },
        ),
        migrations.CreateModel(
            name='ResultEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start', models.DateTimeField(blank=True, null=True)),
                ('kp1', models.DateTimeField(blank=True, null=True)),
                ('kp2', models.DateTimeField(blank=True, null=True)),
                ('kp3', models.DateTimeField(blank=True, null=True)),
                ('finish', models.DateTimeField(blank=True, null=True)),
                ('description', models.TextField(blank=True)),
                ('reg_event', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='event_calendar.RegEvent')),
            ],
            options={
                'ordering': ['reg_event', 'finish'],
            },
        ),
        migrations.CreateModel(
            name='Rules',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('date_in', models.DateField()),
                ('date_out', models.DateField()),
                ('sum', models.FloatField(blank=True, null=True)),
                ('description', models.CharField(max_length=255)),
            ],
            options={
                'ordering': ['date_in'],
            },
        ),
        migrations.AddField(
            model_name='events',
            name='rules',
            field=models.ManyToManyField(blank=True, to='event_calendar.Rules'),
        ),
        migrations.AddField(
            model_name='events',
            name='type',
            field=models.ManyToManyField(blank=True, to='event_calendar.EventType'),
        ),
        migrations.AddField(
            model_name='events',
            name='user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='biketype',
            name='group',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='event_calendar.GroupBikeType'),
        ),
    ]
