Commit 848f58b2 authored by David Haynes's avatar David Haynes 🙆

Merge branch '100-front-royal' into '2.2-dev'

Add front royal campus + critical docker addition + migration tracking

Closes #100

See merge request !49
parents 91dcc369 d5b2bf79
Pipeline #3724 passed with stage
in 1 minute and 5 seconds
......@@ -18,6 +18,8 @@ services:
ports:
- "8000:8000"
command: ./docker-startup.sh
volumes:
- .:/whats-open
depends_on:
- db
environment:
......
# 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'),
),
]
......@@ -59,6 +59,7 @@ class Location(TimeStampedModel):
CAMPUS_LOCATIONS = (
# (set in model, human readable version)
("front royal", "Front Royal"),
("prince william", "Prince William County Science and Technology"),
("fairfax", "Fairfax"),
("arlington", "Arlington"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment