# Generated by Django 2.2.8 on 2019-12-27 12:51

import c3nav.mapdata.fields
import c3nav.mapdata.models.locations
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('mapdata', '0081_auto_20191225_1015'),
    ]

    operations = [
        migrations.CreateModel(
            name='Position',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='name')),
                ('secret', models.CharField(default=c3nav.mapdata.models.locations.get_position_secret, max_length=32, unique=True, verbose_name='secret')),
                ('last_location_update', models.DateTimeField(null=True, verbose_name='last location update')),
                ('location_id', models.CharField(max_length=48, null=True, verbose_name='location')),
                ('api_secret', models.CharField(default="", max_length=64, verbose_name='api secret')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dynamic_positions', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Dynamic position',
                'verbose_name_plural': 'Dynamic position',
                'default_related_name': 'dynamic_positions',
            },
        ),
        migrations.CreateModel(
            name='DynamicLocation',
            fields=[
                ('locationslug_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='dynamic_locations', serialize=False, to='mapdata.LocationSlug')),
                ('title', c3nav.mapdata.fields.I18nField(blank=True, fallback_any=True, fallback_value='{model} {pk}', plural_name='titles', verbose_name='Title')),
                ('can_search', models.BooleanField(default=True, verbose_name='can be searched')),
                ('can_describe', models.BooleanField(default=True, verbose_name='can describe')),
                ('icon', models.CharField(blank=True, help_text='any material icons name', max_length=32, null=True, verbose_name='icon')),
                ('label_override', c3nav.mapdata.fields.I18nField(blank=True, fallback_any=True, plural_name='label_overrides', verbose_name='Label override')),
                ('position_secret', models.CharField(blank=True, max_length=32, null=True, verbose_name='position secret')),
                ('access_restriction', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='dynamic_locations', to='mapdata.AccessRestriction', verbose_name='Access Restriction')),
                ('groups', models.ManyToManyField(blank=True, related_name='dynamic_locations', to='mapdata.LocationGroup', verbose_name='Location Groups')),
                ('label_settings', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='dynamic_locations', to='mapdata.LabelSettings', verbose_name='label settings')),
            ],
            options={
                'verbose_name': 'Dynamic location',
                'verbose_name_plural': 'Dynamic locations',
                'default_related_name': 'dynamic_locations',
            },
            bases=('mapdata.locationslug', models.Model),
        ),
    ]
