0001_initial.py 5.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # -*- coding: utf-8 -*-
  2. # Generated by Django 1.10.5 on 2017-03-15 07:16
  3. from __future__ import unicode_literals
  4. import django.core.validators
  5. from django.db import migrations, models
  6. import django.db.models.deletion
  7. import modelcluster.fields
  8. import wagtail.blocks
  9. import wagtail.fields
  10. import wagtail.embeds.blocks
  11. import wagtail.images.blocks
  12. class Migration(migrations.Migration):
  13. initial = True
  14. dependencies = [
  15. ('wagtailcore', '0032_add_bulk_delete_page_permission'),
  16. ('wagtailimages', '0018_remove_rendition_filter'),
  17. ]
  18. operations = [
  19. migrations.CreateModel(
  20. name='LocationOperatingHours',
  21. fields=[
  22. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  23. ('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
  24. ('day', models.CharField(choices=[('MON', 'Monday'), ('TUES', 'Tuesday'), ('WED', 'Wednesday'), ('THUR', 'Thursday'), ('FRI', 'Friday'), ('SAT', 'Saturday'), ('SUN', 'Sunday')], default='MON', max_length=4)),
  25. ('opening_time', models.TimeField(blank=True, null=True)),
  26. ('closing_time', models.TimeField(blank=True, null=True)),
  27. ('closed', models.BooleanField(help_text='Tick if location is closed on this day', verbose_name='Closed?')),
  28. ],
  29. options={
  30. 'ordering': ['sort_order'],
  31. 'abstract': False,
  32. },
  33. ),
  34. migrations.CreateModel(
  35. name='LocationPage',
  36. fields=[
  37. ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
  38. ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
  39. ('body', wagtail.fields.StreamField((('heading_block', wagtail.blocks.StructBlock((('heading_text', wagtail.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.blocks.CharBlock(required=False)), ('attribution', wagtail.blocks.CharBlock(required=False))))), ('block_quote', wagtail.blocks.StructBlock((('text', wagtail.blocks.TextBlock()), ('attribute_name', wagtail.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.embeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
  40. ('address', models.TextField()),
  41. ('lat_long', models.CharField(help_text="Comma separated lat/long. (Ex. 64.144367, -21.939182) Right click Google Maps and select 'What's Here'", max_length=36, validators=[django.core.validators.RegexValidator(code='invalid_lat_long', message='Lat Long must be a comma-separated numeric lat and long', regex='^(\\-?\\d+(\\.\\d+)?),\\s*(\\-?\\d+(\\.\\d+)?)$')])),
  42. ('image', models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
  43. ],
  44. options={
  45. 'abstract': False,
  46. },
  47. bases=('wagtailcore.page', models.Model),
  48. ),
  49. migrations.CreateModel(
  50. name='LocationsIndexPage',
  51. fields=[
  52. ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
  53. ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
  54. ('body', wagtail.fields.StreamField((('heading_block', wagtail.blocks.StructBlock((('heading_text', wagtail.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.blocks.CharBlock(required=False)), ('attribution', wagtail.blocks.CharBlock(required=False))))), ('block_quote', wagtail.blocks.StructBlock((('text', wagtail.blocks.TextBlock()), ('attribute_name', wagtail.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.embeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
  55. ('image', models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
  56. ],
  57. options={
  58. 'abstract': False,
  59. },
  60. bases=('wagtailcore.page', models.Model),
  61. ),
  62. migrations.AddField(
  63. model_name='locationoperatinghours',
  64. name='location',
  65. field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='hours_of_operation', to='locations.LocationPage'),
  66. ),
  67. ]