0001_initial.py 11.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
# Generated by Django 2.0.10 on 2019-01-26 17:53

import autoslug.fields
from django.conf import settings
import django.contrib.gis.db.models.fields
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import taggit.managers


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('taggit', '0002_auto_20150616_2121'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Alert',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('urgency_tag', models.CharField(choices=[('info', 'Info'), ('minor', 'Minor'), ('major', 'Major'), ('emergency', 'Emergency')], default='Info', max_length=10)),
                ('subject', models.CharField(max_length=130)),
                ('body', models.TextField()),
                ('url', models.URLField()),
                ('start_datetime', models.DateTimeField()),
                ('end_datetime', models.DateTimeField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name': 'category',
                'verbose_name_plural': 'categories',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Facility',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('facility_name', models.CharField(max_length=100)),
                ('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='facility_name', unique=True)),
                ('note', models.TextField(blank=True, help_text='Additional information that is sent with this Facility.', verbose_name='Facility Note')),
                ('logo', models.URLField(blank=True, default='https://wopen-cdn.dhaynes.xyz/default.png', help_text='The absolute URL to the logo image for this Facility.', verbose_name='Logo URL')),
                ('tapingo_url', models.URLField(blank=True, validators=[django.core.validators.RegexValidator(code='invalid_tapingo_url', message='The link is not a valid tapingo link. Example: https://www.tapingo.com/order/restaurant/starbucks-gmu-johnson/', regex='^https:\\/\\/www.tapingo.com\\/')])),
                ('phone_number', models.CharField(blank=True, max_length=18, validators=[django.core.validators.RegexValidator(code='invalid_phone_number', message='Invalid phone number', regex='^\\(?([0-9]{3})\\)?[-.●]?([0-9]{3})[-.●]?([0-9]{4})$')])),
                ('facility_classifier', models.CharField(blank=True, choices=[('shopmason', 'shopMason Facility'), ('sodoxo', 'Sodoxo Facility')], help_text="Tag this facility to be shown on the ShopMason or Sodoxo What's Open sites.", max_length=100)),
                ('facility_category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='categories', to='api.Category')),
            ],
            options={
                'verbose_name': 'facility',
                'verbose_name_plural': 'facilities',
                'ordering': ['facility_name'],
            },
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('building', models.CharField(max_length=100)),
                ('friendly_building', models.CharField(blank=True, help_text='Example: Exploratory Hall becomes EXPL', max_length=10, verbose_name='Building Abbreviation')),
                ('address', models.CharField(max_length=100)),
                ('campus_region', models.CharField(choices=[('front royal', 'Front Royal'), ('prince william', 'Prince William County Science and Technology'), ('fairfax', 'Fairfax'), ('arlington', 'Arlington')], default='fairfax', max_length=100)),
                ('on_campus', models.BooleanField(default=True)),
                ('coordinate_location', django.contrib.gis.db.models.fields.PointField(srid=4326)),
            ],
            options={
                'verbose_name': 'location',
                'verbose_name_plural': 'locations',
            },
        ),
        migrations.CreateModel(
            name='OpenTime',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('start_day', models.IntegerField(choices=[(0, 'Monday'), (1, 'Tuesday'), (2, 'Wednesday'), (3, 'Thursday'), (4, 'Friday'), (5, 'Saturday'), (6, 'Sunday')], default=0)),
                ('end_day', models.IntegerField(choices=[(0, 'Monday'), (1, 'Tuesday'), (2, 'Wednesday'), (3, 'Thursday'), (4, 'Friday'), (5, 'Saturday'), (6, 'Sunday')], default=0)),
                ('start_time', models.TimeField()),
                ('end_time', models.TimeField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Schedule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=100)),
                ('valid_start', models.DateTimeField(blank=True, help_text='Date & time that this schedule goes into effect', null=True, verbose_name='Start Date')),
                ('valid_end', models.DateTimeField(blank=True, help_text='Last date & time that this schedule is in effect', null=True, verbose_name='End Date')),
                ('twenty_four_hours', models.BooleanField(default=False, help_text='Toggle to True if the Facility is open 24 hours. You do not need to specify any Open Times, it will always be displayed as open.', verbose_name='24 hour schedule?')),
                ('schedule_for_removal', models.BooleanField(default=True, help_text='Toggle to False if the schedule should never be removed in the backend. By default, all schedules are automatically deleted after they have expired.', verbose_name='Schedule for removal?')),
                ('promote_to_main', models.BooleanField(default=False, help_text='Upon the start of the schedule, it will be promoted to become the main schedule of the Facility it is attached to rather than a special schedule.', verbose_name='Schedule for promotion?')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='StupidFacilityLabelHack',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='Name')),
                ('slug', models.SlugField(max_length=100, unique=True, verbose_name='Slug')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='StupidLabelHack',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.IntegerField(db_index=True, verbose_name='Object id')),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='api_stupidlabelhack_tagged_items', to='contenttypes.ContentType', verbose_name='Content type')),
                ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='api_stupidlabelhack_items', to='api.StupidFacilityLabelHack')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='opentime',
            name='schedule',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='open_times', to='api.Schedule'),
        ),
        migrations.AddField(
            model_name='facility',
            name='facility_labels',
            field=taggit.managers.TaggableManager(help_text='Labels to describe the Facility that are displayed to the user and can be informative.', related_name='labels', through='api.StupidLabelHack', to='api.StupidFacilityLabelHack', verbose_name='labels'),
        ),
        migrations.AddField(
            model_name='facility',
            name='facility_location',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='facilities', to='api.Location'),
        ),
        migrations.AddField(
            model_name='facility',
            name='facility_product_tags',
            field=taggit.managers.TaggableManager(help_text='A comma seperate list of words that neatly and aptly describe the product that this facility produces. These words are not shown to the use but are rather used in search.', related_name='product_tags', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
        ),
        migrations.AddField(
            model_name='facility',
            name='main_schedule',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='facility_main', to='api.Schedule'),
        ),
        migrations.AddField(
            model_name='facility',
            name='owners',
            field=models.ManyToManyField(to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='facility',
            name='special_schedules',
            field=models.ManyToManyField(blank=True, help_text='This schedule will come into effect only for its specified duration.', related_name='facility_special', to='api.Schedule'),
        ),
    ]